Solved

PDF Viewer In Browser Without Acrobat Reader

Posted on 2004-09-03
8
813 Views
Last Modified: 2012-05-05
My application needs to let people view pdf's right in the browser, without the need to install Acrobat Reader.

What are my options?

A few of my thoughts (which might be all wrong.. nor do i even know how to go out any of them) are:

1. convert pdf pages to images on the fly, and use php to display these images

2. find a java pdf viewer, and simply pass the pdf to the viewer page.

Any thought on how I might accomplish this?

I also want to make sure the user cannot print out the result. They must buy the source pdf if they really want a quality print out. (i know i can never stop them from taking screen shots.. so that's not a problem)
0
Comment
Question by:micamedia
  • 4
  • 3
8 Comments
 
LVL 7

Accepted Solution

by:
petoskey-001 earned 500 total points
ID: 11974187
I would recommend using ImageMagick.

The program you want is called convert.  It's usually found at /usr/local/bin/convert, but it depends out your Linux distribution.  I'm not sure where you would find it in windows right now.

$CONVERT = '/path/to/convert';
$YourPDF = '/path/to/filename.pdf';
$YourJPG = '/path/to/desired/outputfile.jpg';

exec("$CONVERT -resize 640x480 $YourPDF $YourJPG");

ImageMagick could already be on your hosting server.  Try "which convert" at the shell prompt to find out, then "convert --help | more" to see if it says it's ImageMagick.  If you need to download it go to http://www.imagemagick.org/
0
 
LVL 7

Expert Comment

by:petoskey-001
ID: 11974225
That of course is for the convert to JPG option.  I found several Java PDF Viewers, but not free ones.
0
 
LVL 27

Expert Comment

by:Diablo84
ID: 11974291
There is pdfgo - which is a trail - http://www.pdfgo.com/
You will probably need thee Java Virtual Machine installed on your server for that

Theres an online demo of it working here - http://www.icesoft.com/demoA.html

As said by petoskey-001 there are various Java PDF viewers about but they are generally trialware or shareware, rarely freeware
0
 
LVL 27

Expert Comment

by:Diablo84
ID: 11974313
hmm, that said i have just stumbled across this, which can be used in conjunction with Java... im not sure how well geared it is towards what you want but it certainly look to be worth while checking out

homepage: http://www.lowagie.com/iText/
d/l link: http://sourceforge.net/projects/itext/
0
Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

 
LVL 7

Expert Comment

by:petoskey-001
ID: 11974368
A Java viewer should probably be avoided because if your Java Client can download the PDF, your customers can probably view source or watch the request headers sent to the server and get the PDF as well.  You would have to password protect your server and setup the Java Viewer to use some sort of password as well.  Maybe SSL...

Just a thought.
0
 
LVL 1

Author Comment

by:micamedia
ID: 11974422
well, i don't need to worry about my clients figuring out how to intercept the pdf going to the java viewer. They are not that smart.

And i never said the view has to be free. In fact i don't expect it to be.

Now.. if i use imagemagik, will it allow me to cover all the pages of the pdf to an image? And then once i get that far, how do i make a viewer for the image that isn't just a simple click here to view the image. I don't want that as they would just click here, and print it out. That's no good.

Dan
0
 
LVL 7

Expert Comment

by:petoskey-001
ID: 11974498
I would go with one of the Java viewers then.  Any JPG you give create really be protected.  I was thinking of it more as a thumbnail generator.  I suppose a JPG could be protected, but only by using something like a java or flash viewer anyway so you might as well go with the PDF viewer.  

I know little about them, but the icesoft one listed above shows up first in a google search.  
0
 
LVL 27

Expert Comment

by:Diablo84
ID: 11974626
Its like the old saying, if you want your work protected don't put it on the web.

Pretty much anything can be obtained one way or another, direct download, hooking the file out of the temp internet files, screen dumps, the list goes on.

Something like a Java viewer will help the cause as the user will only be able to view the document, there is still print screen as i think has been said before but its more secure then the alternatives.
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This article will explain how to display the first page of your Microsoft Word documents (e.g. .doc, .docx, etc...) as images in a web page programatically. I have scoured the web on a way to do this unsuccessfully. The goal is to produce something …
Foreword (July, 2015) Since I first wrote this article, years ago, a great many more people have begun using the internet.  They are coming online from every part of the globe, learning, reading, shopping and spending money at an ever-increasing ra…
The viewer will learn how to look for a specific file type in a local or remote server directory using PHP.
This tutorial will teach you the core code needed to finalize the addition of a watermark to your image. The viewer will use a small PHP class to learn and create a watermark.

895 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

18 Experts available now in Live!

Get 1:1 Help Now