Advanced Search

Page 1 of 2 12 LastLast
Results 1 to 10 of 12

Thread: Combining 2 print scripts

  1. #1
    Join Date
    Jun 2007
    Location
    North Lake Tahoe
    Posts
    62
    Thanks
    7
    Thanked 0 Times in 0 Posts

    Default Combining 2 print scripts

    1) Script Title: Dynamic Drive- Cross-browser print button and
    Alternate document for printing

    2) Script URL (on DD): http://www.dynamicdrive.com/dynamicindex9/other1.htm and
    http://www.dynamicdrive.com/dynamici...printstyle.htm

    3) Describe problem: Is it possible to use both of the abovr scripts on the same web page?
    I want to print a coupon without printing the button. When I try printing, I get the message "Page not found"

    www.noahsvideo.com/pelusocoupon.htm

  2. #2
    Join Date
    Feb 2008
    Location
    Cebu City Philippines
    Posts
    1,160
    Thanks
    17
    Thanked 277 Times in 275 Posts

    Default

    Yes, both of them can be combined in one page
    When I try printing, I get the message "Page not found"
    It's because you had link it to a page where i'm not even sure that you had uploaded in your server:
    http://www.noahsvideo.com/printerversion.doc

    Printerversion.doc is the file that you wanted to be printer, but it does'nt even shows up
    ..as a result..Page cannot be found error is printed
    Learn how to code at 02geek

    The more you learn, the more you'll realize there's much more to learn
    Ray.ph!

  3. #3
    Join Date
    Jun 2007
    Location
    North Lake Tahoe
    Posts
    62
    Thanks
    7
    Thanked 0 Times in 0 Posts

    Default

    I'm sorry I'm such a dufus, but where do I place, http://www.noahsvideo.com/printerversion.doc

    <SCRIPT Language="Javascript">

    /*
    This script is written by Eric (Webcrawl@usa.net)
    For full source code, installation instructions,
    100's more DHTML scripts, and Terms Of
    Use, visit dynamicdrive.com
    */

    function printit(){
    if (window.print) {
    window.print() ;
    } else {
    var WebBrowser = '<OBJECT ID="WebBrowser1" WIDTH=0 HEIGHT=0 CLASSID="CLSID:8856F961-340A-11D0-A96B-00C04FD705A2"></OBJECT>';
    document.body.insertAdjacentHTML('beforeEnd', WebBrowser);
    WebBrowser1.ExecWB(6, 2);//Use a 1 vs. a 2 for a prompting dialog box WebBrowser1.outerHTML = "";
    }
    }
    </script>

    <SCRIPT Language="Javascript">
    var NS = (navigator.appName == "Netscape");
    var VERSION = parseInt(navigator.appVersion);
    if (VERSION > 3) {
    document.write('<form><input type=button value="Print this Page" name="Print" onClick="printit()"></form>');
    }
    </script>

  4. #4
    Join Date
    Jun 2007
    Location
    North Lake Tahoe
    Posts
    62
    Thanks
    7
    Thanked 0 Times in 0 Posts

    Default

    Oooops, I mean: Printerversion.doc

  5. #5
    Join Date
    Feb 2008
    Location
    Cebu City Philippines
    Posts
    1,160
    Thanks
    17
    Thanked 277 Times in 275 Posts

    Default

    Nop, this has nothing to do with the script

    ...Upload in your server the file printerversion.doc
    Learn how to code at 02geek

    The more you learn, the more you'll realize there's much more to learn
    Ray.ph!

  6. #6
    Join Date
    Jun 2007
    Location
    North Lake Tahoe
    Posts
    62
    Thanks
    7
    Thanked 0 Times in 0 Posts

    Default

    Ok, here's another dumb question.....I just did a search and I can't find the file printerversion.doc

  7. #7
    Join Date
    Feb 2008
    Location
    Cebu City Philippines
    Posts
    1,160
    Thanks
    17
    Thanked 277 Times in 275 Posts

    Default

    Create your own.....a file..either through Adobe Acrobat or MS Word, Excel, PPT of your own.

    A file which you wanted to print when the user hit's ctrl + p or when they click the button Print Coupon.

    ....Read DD..It will help you understand much better.

    You just have to note...that printerversion.doc is a file...it's a MS Word file that will be printed when the user tries to print...hope that makes sense
    Learn how to code at 02geek

    The more you learn, the more you'll realize there's much more to learn
    Ray.ph!

  8. #8
    Join Date
    Mar 2006
    Location
    Illinois, USA
    Posts
    12,154
    Thanks
    260
    Thanked 690 Times in 678 Posts

    Default

    I do not think you should be using a Microsoft word document. that requires that the visitor 1. have microsoft word and 2. that they open it just to print.
    Save an alternate html file; the rest should work similarly.

    However, in the end, the best idea with this is not to do something complex with Javascript, but just have a "printable version" link and link to the other page. Then the user can print whichever version they want. That is what most good sites do.
    Daniel - Freelance Web Design | <?php?> | <html>| espa˝ol | Deutsch | italiano | portuguŕs | catalÓ | un peu de franšais | some knowledge of several other languages: I can sometimes help translate here on DD | Linguistics Forum

  9. #9
    Join Date
    Jun 2007
    Location
    North Lake Tahoe
    Posts
    62
    Thanks
    7
    Thanked 0 Times in 0 Posts

    Default

    How do I get the print button to print another page. That was my first thought.

  10. #10
    Join Date
    Jun 2007
    Location
    North Lake Tahoe
    Posts
    62
    Thanks
    7
    Thanked 0 Times in 0 Posts

    Default

    Thanks, I tried typing a word document and I tries importing a file from Photoshop anboth just printed a blank page

    t
    Quote Originally Posted by rangana View Post
    Create your own.....a file..either through Adobe Acrobat or MS Word, Excel, PPT of your own.

    A file which you wanted to print when the user hit's ctrl + p or when they click the button Print Coupon.

    ....Read DD..It will help you understand much better.

    You just have to note...that printerversion.doc is a file...it's a MS Word file that will be printed when the user tries to print...hope that makes sense

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •