different window for pdf

Discussion in 'HTML & Website Design' started by aikencolon, Jul 25, 2008.

  1. #1
    I was just wondering how to get a pdf to pop up in a new window. I really don't want to send people to a pdf page that may take ahwile to load. Which even though it is on my site I feel as though it has the safe effect as taking them off the site.

    thanks in advance

    JJ
     
    aikencolon, Jul 25, 2008 IP
  2. Peter Brown

    Peter Brown Well-Known Member

    Messages:
    1,638
    Likes Received:
    117
    Best Answers:
    0
    Trophy Points:
    180
    #2
    <a href="javascript:window.open('http://site.com/pdf.pdf')">www.site.com</a>
     
    Peter Brown, Jul 25, 2008 IP
  3. kk5st

    kk5st Prominent Member

    Messages:
    3,497
    Likes Received:
    376
    Best Answers:
    29
    Trophy Points:
    335
    #3
    Leave that entirely to the visitor's discretion. It is polite, though, to explicitly indicate that the link leads to a pdf file.

    Peter Brown's suggested javascript: solution is extremely poor practice. It leaves people with uninstalled or disabled javascript unable to access the document, and it breaks the right click options.

    cheers,

    gary
     
    kk5st, Jul 25, 2008 IP
  4. Stomme poes

    Stomme poes Peon

    Messages:
    3,195
    Likes Received:
    136
    Best Answers:
    0
    Trophy Points:
    0
    #4
    Our old site used to open a new window for all pdf's. The reasoning for this was that the new window had the postal address. The users were expected to have the pdf opened, they'd fill it out, and then print out the pdf and close it-- leaving the new window with the postal address on their screens.

    When I redid the site, I realised that you can't fill in and send a pdf without the user having all this whole Adobe Acrobat suite and it's like 900usd so I was like, screw that. Other than my inability to stick the postal address on the pdf itself (since I don't have access to that file), I've gotten it set up pretty good I think.
    
          <ul id="topmenu">
            <li><a title="opent in PDF" href="pdf/pdf.php?pdf=mutatie.pdf">Mutatieformulier</a> |</li>
            <li><a title="opent in PDF" href="pdf/pdf.php?pdf=aanvraag.pdf">Aanvraagformulier</a> |</li>
            <li class="laast"><a title="opent in PDF" href="pdf/pdf.php?pdf=polis.pdf">Polisvoorwaarden</a></li>
          </ul>
    
    Code (markup):
    Everyone except IE6 and older sees the PDF logo, which I stole without permission from Adobe to use.
    
    a[href$=".pdf"] {
      line-height: 1.88em;
      padding-right: 29px;
      background: url(../images/pdf-icon.gif) 100% 50%  no-repeat;
    }
    
    Code (markup):
    Because the user's document reader has to really open the PDF, the browser actually stays on the page (unless it's a browser that can open PDFs... I don't have one it seems). And some people just don't have a document reader-- so always have an HTML version on the site somewhere.
     
    Stomme poes, Jul 28, 2008 IP