This week's book giveaways are in the AI and JavaScript forums.
We're giving away four copies each of GANs in Action and WebAssembly in Action and have the authors on-line!
See this thread and this one for details.
Win a copy of GANs in ActionE this week in the AI forum
or WebAssembly in Action in the JavaScript forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Bear Bibeault
  • Paul Clapham
  • Jeanne Boyarsky
  • Knute Snortum
Sheriffs:
  • Liutauras Vilda
  • Tim Cooke
  • Junilu Lacar
Saloon Keepers:
  • Ron McLeod
  • Stephan van Hulst
  • Tim Moores
  • Tim Holloway
  • Carey Brown
Bartenders:
  • Joe Ess
  • salvin francis
  • fred rosenberger

PDF Files

 
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
 
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
 
Rancher
Posts: 43011
76
  • 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).
 
Ruth Stout was famous for gardening naked. Just like this tiny ad:
Java file APIs (DOC, XLS, PDF, and many more)
https://products.aspose.com/total/java
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!