Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 3 of 3
  1. #1
    New to the CF scene
    Join Date
    Oct 2007
    Posts
    1
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Is there a way to put a pdf viewer in a html doc

    I'm running a website that I'm using pdf's for guides and such is there a way instead of it opening in just a viewer but instead I can have it open in the layout so people can use the comment script i have on all my pages. I have seen people do it I just don't know how.
    Thanks in advance.

  • #2
    New Coder
    Join Date
    Oct 2007
    Location
    Irwin, PA
    Posts
    23
    Thanks
    2
    Thanked 0 Times in 0 Posts
    You can try putting the location of your PDF file on your server in an iframe... that would be the simplest approach without getting any complex programming involved.

    Code:
    <iframe src="myfile.pdf" width="400" height="400">
    
    </iframe>
    Something like that. You can also make it have no scrollbars and stuff. I never got into iframes but it would make sense and be a practicle solution for using a PDF embedded into a page.

  • #3
    Master Coder felgall's Avatar
    Join Date
    Sep 2005
    Location
    Sydney, Australia
    Posts
    6,642
    Thanks
    0
    Thanked 649 Times in 639 Posts
    The following is shorter and should also work in older browsers that don't recognise iframes.

    <img src="myfile.pdf" width="400" height="400">
    Stephen
    Learn Modern JavaScript - http://javascriptexample.net/
    Helping others to solve their computer problem at http://www.felgall.com/

    Don't forget to start your JavaScript code with "use strict"; which makes it easier to find errors in your code.


  •  

    Posting Permissions

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