Win a copy of Programmer's Guide to Java SE 8 Oracle Certified Associate (OCA) this week in the OCAJP forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

PDF Files

 
colin shuker
Ranch Hand
Posts: 750
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi, I'm using the iText-2.1.5.jar to create pdf files.

So far I am able to create a pdf file in java and save it to a location.
I would like to be able to create a pdf file in java, then just open it, without saving to any location.

Can anyone help me? Thanks
 
Allain Walker
Greenhorn
Posts: 14
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Colin,
I have only used iText a couple of times but I am pretty sure that one has to save the file to view it, I am happy to be corrected if I am wrong. I used it when generating report files and receipts, so we had to store them anyhoo, but I seem to remember it has to be stored to be viewed.
On saying that though, I have just found this link, it shows PDF being generated to a HTTP request, webpage , but it is still writing the document to an OutputStream, so I don't really think this will help.
 
colin shuker
Ranch Hand
Posts: 750
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks, I already looked at that page.

What I've done is...
Save file in the projects root, then open with:

I gather that this code will only work with windows, and it does not rely on the iText.jar package.
I was wondering if there was any code in that package that will open a pdf file instead of the code above.

Thanks
 
Allain Walker
Greenhorn
Posts: 14
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
It is good that I can still learn new stuff every day, thanks for showing me that.
As for just opening it, you would need to have the reader implemented in a jar file, which I don't think happens in iText.
I have just done a quick Google and found this JPedal, is this the kind of thing you are looking for?
 
colin shuker
Ranch Hand
Posts: 750
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks, that seems expensive and a bit complicated for my needs.
Perhaps the demo is worth downloading
 
Ulf Dittmer
Rancher
Posts: 42968
73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks, that seems expensive and a bit complicated for my needs.

The LGPL version includes the viewer, albeit with a reduced feature set (for example, no printing).
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic