Win a copy of Microservices Testing (Live Project) this week in the Spring 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 Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Tim Cooke
  • Ron McLeod
  • Jeanne Boyarsky
  • Paul Clapham
Sheriffs:
  • Liutauras Vilda
  • Henry Wong
  • Devaka Cooray
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • Al Hobbs
  • Carey Brown
Bartenders:
  • Piet Souris
  • Mikalai Zaikin
  • Himai Minh

PDF Files

 
Ranch Hand
Posts: 750
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks, that seems expensive and a bit complicated for my needs.
Perhaps the demo is worth downloading
 
Rancher
Posts: 43028
76
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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).
 
Consider Paul's rocket mass heater.
reply
    Bookmark Topic Watch Topic
  • New Topic