Iframe view of PDF

Asked

Viewed 11,327 times

4

It’s been a while since I’ve been looking for how to view PDF files in an iframe or div on the page itself, instead of opening in a new one and using Adobe Reader.

Only the problem is that the files are not fixed, they come from a code that generates them in PHP.

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

  • 1

    Yes, but what is the doubt?

  • 1

    I believe these questions can help, how to create a pdf stream in php and pdf view in browser

  • 1

    Could you please be more specific with your question? Maybe just changing the way it was written helps users to be sure what you need to know. Otherwise it could end up being closed. If one of the @lost messes answers your question, please close your question when editing, as it can be treated as duplicate. Thank you.

2 answers

3


If you are looking for a full visualizator on this website There are several examples with demonstrations and downloadable files. There is a jQuery plug-in PDF viewer and tutorial with examples. Due to the popularity of online document viewer, as Google Docs some javascript developers have developed a good and useful plugin to view pdf file in online Viewer. On it is a good list of online PDF viewers.

2

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

EDIT

You could generate the PDF, allow it to be accessible through the internet:

Example: http://meudominio.com/arquivo.pdf

Here comes the Google Docs Viewer. You do not need to transfer the file to Google Docs, just indicate the URL of any PDF accessible by 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>
  • The problem is that these files are generated by a system and not to register them in google Docs manually, are many... But the idea is very good!

  • 1

    @Clarabatt the idea is you generate the link by your system, you do not need to register anything in google Docs. See the SRC that Miguel used in the example.

Browser other questions tagged

You are not signed in. Login or sign up in order to post.