Win a copy of Kotlin in Action this week in the Kotlin forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

writing PDF to a file in java  RSS feed

 
Priya Sri
Ranch Hand
Posts: 84
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi all,

I want to write a PDF file to a file in java thru java servlet. Please guide me how can I achieve that.

bye
Thanks in advance.
 
Ulf Dittmer
Rancher
Posts: 42972
73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Doing file I/O in a servlet in no different than file I/O in a desktop app.

If, on the other hand, you want to stream a PDF to a browser, that's no different than streaming any other binary content.

Or is the problem the cretaion of PDF content? There are several libraries that help with this, they're listed on the AccessingFileFormats wiki page. iText in particular is very popular, or FOP if you have structured data in an XML format.
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!