PDF view in iframe

3

I already have some time I'm looking for how to view the PDF files in an iframe or a div on the page itself instead of opening it in a new one and using Adobe Reader.

But the problem is that the files are not fixed, they come from a code that they generate in PHP.

I want to know how to put this command to open in the iframe itself instead of on another page.

    
asked by anonymous 25.03.2014 / 18:42

2 answers

3

If you are looking for a full viewer on this site there are several examples with demonstrations and files for download. In it there is a jQuery plug-in PDF viewer and tutorial with examples. Due to the popularity of online document viewer such as Google Docs some javascript developers have developed a nice and useful plugin to view pdf file in online pdf viewer. Here is a good list of PDF viewers online.

    
25.03.2014 / 19:08
2

You can use the Google Docs viewer to view online documents on your page by placing an IFrame from the viewer.

EDIT

You could generate the PDF, make it accessible via the internet:

Example: link

Here's the Google Docs Viewer. You do not need to transfer the file to Google Docs, just enter the URL of any accessible PDF on the internet that will work:

<iframe src="http://docs.google.com/viewer?url=http%3A%2F%2Fmeudominio.com%2Farquivo.pdf&embedded=true"width="600" height="780" style="border: none;"></iframe>
    
25.03.2014 / 18:48