SitePoint Sponsor

User Tag List

Results 1 to 7 of 7

Thread: PDF reader ?

  1. #1
    SitePoint Wizard
    Join Date
    Jun 2005
    Posts
    1,429
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Question PDF reader ?

    If you have a pdf on your website that visitors would like to read, is there any way of the website somehow 'seeing' if they have a pdf reader on their pc please ? and if they don't have a reader on their pc, to then put a message up saying, something like, to read this pdf, you'll need to . . . . .

  2. #2
    Mouse catcher silver trophy Stevie D's Avatar
    Join Date
    Mar 2006
    Location
    Yorkshire, UK
    Posts
    5,881
    Mentioned
    122 Post(s)
    Tagged
    1 Thread(s)
    I've never heard of any way to detect that. Given that the vast majority of websites simply say "If you don't have Acrobat Reader installed, click here to download it" (and the rest don't say owt at all), I would be surprised if there was a better way of doing it.

  3. #3
    Robert Wellock silver trophybronze trophy xhtmlcoder's Avatar
    Join Date
    Apr 2002
    Location
    A Maze of Twisty Little Passages
    Posts
    6,316
    Mentioned
    60 Post(s)
    Tagged
    0 Thread(s)
    Probably the nearest you can do sensibly without getting to complex is provide a link to the PDF and make sure it has the correct MIME. For example:

    <a href="example.pdf" type="application/pdf" title="Link to Example PDF document">[PDF document]</a>

    Then obviously provide a link as to where you can download the PDF Reader. The browser will then be armed with enough information to search for an appropriate plugin if it doesn't already have such a reader.

  4. #4
    SitePoint Wizard
    Join Date
    Jun 2005
    Posts
    1,429
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Thanks Robert, is there a preferred place on the net to d/load from ?

  5. #5
    Robert Wellock silver trophybronze trophy xhtmlcoder's Avatar
    Join Date
    Apr 2002
    Location
    A Maze of Twisty Little Passages
    Posts
    6,316
    Mentioned
    60 Post(s)
    Tagged
    0 Thread(s)
    Well, usually Adobe is synonymous with PDF although there are loads of other Readers. The usual link is as follows: http://www.adobe.com/products/acrobat/readstep.html

  6. #6
    SitePoint Wizard bronze trophy C. Ankerstjerne's Avatar
    Join Date
    Jan 2004
    Location
    The Kingdom of Denmark
    Posts
    2,702
    Mentioned
    7 Post(s)
    Tagged
    0 Thread(s)
    I think this should theoretically work, but at least Internet Explorer 6 does not want to play ball:

    Code php:
    if(!strstr($_SERVER["HTTP_ACCEPT"], "application/pdf")) {
     echo "Download Adobe Reader to view this document.";
    }
    else {
    }
    Christian Ankerstjerne
    <p<strong<abbr/HTML/ 4 teh win</>
    <>In Soviet Russia, website codes you!

  7. #7
    om nom nom nom Stomme poes's Avatar
    Join Date
    Aug 2007
    Location
    Netherlands
    Posts
    10,272
    Mentioned
    50 Post(s)
    Tagged
    2 Thread(s)
    I provide an HTML version that works with the print stylesheet. Then people can do whatever they want: they're at your website so we know they can deal with HTML : )


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
  •