PDF Viewer In Browser Without Acrobat Reader

Posted on 2004-09-03
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)
Question by:micamedia
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 4
  • 3

Accepted Solution

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

Expert Comment

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

Expert Comment

ID: 11974291
There is pdfgo - which is a trail -
You will probably need thee Java Virtual Machine installed on your server for that

Theres an online demo of it working here -

As said by petoskey-001 there are various Java PDF viewers about but they are generally trialware or shareware, rarely freeware
Revamp Your Training Process

Drastically shorten your training time with WalkMe's advanced online training solution that Guides your trainees to action.

LVL 27

Expert Comment

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

d/l link:

Expert Comment

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.

Author Comment

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.


Expert Comment

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.  
LVL 27

Expert Comment

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.

Featured Post

Why Off-Site Backups Are The Only Way To Go

You are probably backing up your data—but how and where? Ransomware is on the rise and there are variants that specifically target backups. Read on to discover why off-site is the way to go.

Question has a verified solution.

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

Things That Drive Us Nuts Have you noticed the use of the reCaptcha feature at EE and other web sites?  It wants you to read and retype something that looks like this. Insanity!  It's not EE's fault - that's just the way reCaptcha works.  But it i…
This article discusses four methods for overlaying images in a container on a web page
The viewer will learn how to dynamically set the form action using jQuery.
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.

615 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