Javascript ?

Discussion in 'Web Design and Development' started by chepistolas, Jun 6, 2007.

  1. chepistolas macrumors member

    chepistolas

    Joined:
    Apr 21, 2005
    Location:
    Chicago
    #1
    I have a problem. . I can't seem to find a way to put a print command on my site. Do print commands even use javascript? Can anyone please give me advice or point me to a website that dosen't concentrate on using I.E 4. Thanks in advance. Luis Gomez.
     
  2. angelwatt Moderator emeritus

    angelwatt

    Joined:
    Aug 16, 2005
    Location:
    USA
    #2
    Last I checked there's no "standard" way of setting it up so that it works across browsers and OSs.
     
  3. mags631 Guest

    Joined:
    Mar 6, 2007
    #3
    Have you tried the window.print() method?

    <input type="button" value="Print" onclick="javascript:window.print()" />
     
  4. snickelfritz macrumors 65816

    snickelfritz

    Joined:
    Oct 24, 2003
    Location:
    Tucson AZ
    #4
    The method I use, is to create "printer friendly" documents in PDF for the pages that will likely need to be printed, then embed the File>Print action into the document pages using Indesign and Acrobat Pro.

    I use print resolution (175ppi or so) PNG8(line art) or PNG24(continuous tone) for placed graphics, for fast download and good quality prints.
    PDF format is "press-ready", with no image compression.
    The indesign PDF is opened in Acrobat Pro and the desired actions embedded in the pages.

    The "Print page" link on the site opens the PDF, and the printer dialog appears automatically.

    GL
     
  5. chepistolas thread starter macrumors member

    chepistolas

    Joined:
    Apr 21, 2005
    Location:
    Chicago
    #5
    I've tried the window.print() but it shows up as a button. I want it to display withouth the button, so users see it as a link instead.

    <div id="afterarticle">
    <span class="discuss"><a href="/forum/article"> discuss</a></span>
    <span class="email"><a href="emailform.html" rel="gb_page_fs[]"> e-mail</a></span>
    <span class="print"><a href="{javascript code ?}"> print</a></span>
    </div>

    EDIT:
    I've GOT IT! !
    for those of you who would like to make it look like a link just make it like this:

    <a href="javascript:window.print()"> print</a>

    There is a problem though, it prints the page into two pages.
     

Share This Page