Display pdf on website

We want to display the pdf file on the web page. From what I can think, I see two possible solutions, displaying a file with some kind of reader in PDF format (perhaps in flash?) Or converting a pdf file to html before displaying it.

How would you decide to solve such a problem? What would be the preferred method?

+4
source share
7 answers

Well, there is always a third way: to serve the PDF itself and leave the rest to visitors.

+12
source

For public websites, you can improve the user interface and reduce bandwidth overhead by pasting your PDF documents into your pages using one of the document sharing services, for example:

http://www.scribd.com

http://www.docstoc.com

I should also add that scribd also has an API for loading documents (and more).

+2
source

If you absolutely need to display PDF in a browser, you can use FlashPaper. It is installed on Windows as a printer and allows you to convert any document into SWF that you embed in your HTML.

I used it in several projects, but this is not an ideal solution. From a user’s point of view, it’s best to be able to download a PDF file and read it using your favorite PDF viewer.

+1
source

Try using html tags for embedding or object.

http://blog.flashcolony.com/?p=244

+1
source

Personally, I would not bother with this and just relied on the user to have a proper PDF reader. If you go for a flash solution (or silverlight?), You impose one more requirement on the user to hide the first one. Converting PDF to HTML, on the other hand, is not so simple, just look at how the output from the Gmail function looks like html.

As already mentioned, like the others already published, when I write this, I am sure there is no need to worry and just let the visitor deal with reading pdf using; -)

0
source

A solution not mentioned by others is to rasterize the PDF (say through ghostscript) and serve the resulting image as PNG, JPG, etc. You need to choose a resolution (maybe 72 dpi), and you must understand that the document will become much less readable, especially for sensitive visitors.

0
source

Create the PHP file as follows: I call this first php file "firstfile.php"

<?php header('Content-type: application/pdf'); $file='yourpdffile.pdf'; @readfile($file); ?> 

Then create another PHP file and use iframe to get the desired PDF file. Code example below

 <iframe src="http://localhost/Domainfolder/firstfile.php>" height="400px" width="750px"> </iframe> 

This should do the trick if you are not linking well. Enjoy;)

-1
source

All Articles