Monday, September 22, 2014

Embed a pdf viewer into a web page.

Method 1: Use a google doc viewer.

1. Copy the file to the google drive.
2. Go to the web google drive 
3. Right click the file to choose "disable viewers to download". 
4. Right click the file and open the file with Google driver viewer.
5. In the viewer, choose the link to show the embedded item and copy the link, e.g., 
     
<iframe src="https://docs.google.com/file/d/0xxxxxxx/preview" width="1000" height="1000"></iframe>   

6. Paste the link to your html file. Note that the viewer can still save your files as individual images.


Method 2: Use SWF player.
1. Convert pdf file to swf file by using pdf2swf tool
2. Put the swf file to your web directory and add the following link in your html file

<iframe src="yourpdf.swf" width="1000" height="1000"></iframe>

Now the viewer can only print the images but not save them. However, the viewer
cannot scroll through multiple pages like the google viewer.  




No comments:

Post a Comment