SitePoint Sponsor

User Tag List

Results 1 to 9 of 9
  1. #1
    SitePoint Enthusiast rajeev13's Avatar
    Join Date
    Nov 2012
    Location
    New Delhi,India
    Posts
    35
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Question viewing a pdf file into div using php

    Hi all,
    I working on a php project where a pdf has to be shown in div container .
    I have googled around this and on this forum also.
    If anybody can help.please help me on this topic.

    thanks&regards
    Rajeev Ranjan .

  2. #2
    Mouse catcher silver trophy
    Stevie D's Avatar
    Join Date
    Mar 2006
    Location
    Yorkshire, UK
    Posts
    5,835
    Mentioned
    113 Post(s)
    Tagged
    1 Thread(s)
    Quote Originally Posted by rajeev13 View Post
    I working on a php project where a pdf has to be shown in div container .
    I have googled around this and on this forum also.
    If anybody can help.please help me on this topic.
    Whether a person's browser will show a PDF embedded within a page depends on their browser and plug-in settings. In my experience, the majority of people have it set so that PDFs launch Adobe Reader as a separate application, rather than as a plug-in within the browser, meaning that you can't achieve what you're after for those people.

  3. #3
    Always A Novice bronze trophy
    K. Wolfe's Avatar
    Join Date
    Nov 2003
    Location
    Columbus, OH
    Posts
    2,082
    Mentioned
    54 Post(s)
    Tagged
    0 Thread(s)
    Well... While Stevie D is correct here, you COULD run some PDF libs to convert to jpegs on the fly

  4. #4
    SitePoint Enthusiast rajeev13's Avatar
    Join Date
    Nov 2012
    Location
    New Delhi,India
    Posts
    35
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    i used iframe but this need pdf plug-in on the browser,so i have used google doc viewer to show pdf content.
    Code:
     <html>
    <body>
    <iframe src="http://docs.google.com/gview?url=http://norefresh.thesparxitsolutions.com/rajeev_ranjan/filename.pdf&embedded=true" style="width:600px; height:500px;" frameborder="0"></iframe>
    <div>
    
    </div>
    </body>
    </html>

  5. #5
    Programming Since 1978 silver trophybronze trophy felgall's Avatar
    Join Date
    Sep 2005
    Location
    Sydney, NSW, Australia
    Posts
    16,607
    Mentioned
    24 Post(s)
    Tagged
    1 Thread(s)
    If the browser supports displaying PDFs in the browser then the following is the simplest solution:

    <div><img src="something.pdf" alt="unfortunately your browser doesn't display PDF's"></div>
    Stephen J Chapman

    javascriptexample.net, Book Reviews, follow me on Twitter
    HTML Help, CSS Help, JavaScript Help, PHP/mySQL Help, blog
    <input name="html5" type="text" required pattern="^$">

  6. #6
    SitePoint Enthusiast rajeev13's Avatar
    Join Date
    Nov 2012
    Location
    New Delhi,India
    Posts
    35
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by felgall View Post
    If the browser supports displaying PDFs in the browser then the following is the simplest solution:

    <div><img src="something.pdf" alt="unfortunately your browser doesn't display PDF's"></div>
    Again it needs pdf plug-in.
    is there any third party tool to show pdf on the site like we see on other sites like scribd.

  7. #7
    Programming Since 1978 silver trophybronze trophy felgall's Avatar
    Join Date
    Sep 2005
    Location
    Sydney, NSW, Australia
    Posts
    16,607
    Mentioned
    24 Post(s)
    Tagged
    1 Thread(s)
    A PDF is never the original source - if you want to display in the web page without needing a PDF prugin then it is best to convert the original source into a different web supported format.
    Stephen J Chapman

    javascriptexample.net, Book Reviews, follow me on Twitter
    HTML Help, CSS Help, JavaScript Help, PHP/mySQL Help, blog
    <input name="html5" type="text" required pattern="^$">

  8. #8
    Always A Novice bronze trophy
    K. Wolfe's Avatar
    Join Date
    Nov 2003
    Location
    Columbus, OH
    Posts
    2,082
    Mentioned
    54 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by felgall View Post
    A PDF is never the original source - if you want to display in the web page without needing a PDF prugin then it is best to convert the original source into a different web supported format.
    JPEG, with cool little javascript zoom ability

  9. #9
    SitePoint Enthusiast rajeev13's Avatar
    Join Date
    Nov 2012
    Location
    New Delhi,India
    Posts
    35
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by K. Wolfe View Post
    JPEG, with cool little javascript zoom ability
    Ok. i will try that.


Tags for this Thread

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
  •