Solved

PDF Viewer In Browser Without Acrobat Reader

Posted on 2004-09-03
8
812 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
Comment Utility
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
Comment Utility
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
Comment Utility
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
Comment Utility
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
Easy Project Management (No User Manual Required)

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

 
LVL 7

Expert Comment

by:petoskey-001
Comment Utility
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
Comment Utility
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
Comment Utility
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
Comment Utility
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

How to improve team productivity

Quip adds documents, spreadsheets, and tasklists to your Slack experience
- Elevate ideas to Quip docs
- Share Quip docs in Slack
- Get notified of changes to your docs
- Available on iOS/Android/Desktop/Web
- Online/Offline

Join & Write a Comment

Deprecated and Headed for the Dustbin By now, you have probably heard that some PHP features, while convenient, can also cause PHP security problems.  This article discusses one of those, called register_globals.  It is a thing you do not want.  …
I imagine that there are some, like me, who require a way of getting currency exchange rates for implementation in web project from time to time, so I thought I would share a solution that I have developed for this purpose. It turns out that Yaho…
The viewer will learn how to create and use a small PHP class to apply a watermark to an image. This video shows the viewer the setup for the PHP watermark as well as important coding language. Continue to Part 2 to learn the core code used in creat…
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.

772 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

12 Experts available now in Live!

Get 1:1 Help Now