File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Other JSE/JEE APIs and the fly likes PDF API Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Other JSE/JEE APIs
Bookmark "PDF API" Watch "PDF API" New topic


Zulfikar Dharmawan
Ranch Hand

Joined: Feb 01, 2002
Posts: 74
Are there any API that can be used to open PDF file? I know FOP can make PDF on the fly, but i just need to show the PDF, more like an Acrobat API but completely written in Java. Are there any?
Thanks before...

Zulfikar Dharmawan
SCJP1.4, ICS DB2, ICD Websphere
Tim Holloway
Saloon Keeper

Joined: Jun 25, 2001
Posts: 17417

Whether a PDF is to be saved as a file or to open (either in a browser window or stand-alone Acrobat Reader) is primarily determined by the MIME settings on the client's computer. Most modern-day web browsers allow the default behavior to be overriden if you send the "Content-Disposition" HTTP header with appropriate instructions.
Of course, no popular OS I know of currently comes "out of the box" with Acrobat Reader pre-installed, so it won't work at all unless the client has already installed Acrobat.
Which is why you usually see a "get Acrobat Reader" button on web pages that will transmit PDF's.

An IDE is no substitute for an Intelligent Developer.
William Brogden
Author and all-around good cowpoke

Joined: Mar 22, 2000
Posts: 13037
As I recall, Adobe actually made an all Java PDF reader and made it available. Look around on the Adobe site.
David Rocks
Ranch Hand

Joined: Apr 24, 2001
Posts: 162
I have used a PDF API recently that can open a PDF through a java API calleed pdflib. we use it to open a PDF template and then write on to it, store it on our server and then create a link to it on a JSP page. It does the job for us. I think it costs a small bit but you can get an evaluation.
Zulfikar Dharmawan
Ranch Hand

Joined: Feb 01, 2002
Posts: 74
Hi guys,
Thanks for responding. Can i use the Adobe Acrobat API or as what David said, pdflib, to make an applet similar to Acrobat Reader plugin for web browser?
So, instead of the document thrown by the server is ahndled by the client / browser plugin, i show it using applet. I hope you guys understand what i want to say.
Thanks again...
I agree. Here's the link:
subject: PDF API
It's not a secret anymore!