This week's book giveaway is in the OO, Patterns, UML and Refactoring forum.
We're giving away four copies of Refactoring for Software Design Smells: Managing Technical Debt and have Girish Suryanarayana, Ganesh Samarthyam & Tushar Sharma on-line!
See this thread for details.
The moose likes Servlets and the fly likes Response Output as PDF Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


JavaRanch » Java Forums » Java » Servlets
Bookmark "Response Output as PDF" Watch "Response Output as PDF" New topic
Author

Response Output as PDF

Vishnu Prakash
Ranch Hand

Joined: Nov 15, 2004
Posts: 1026
How to write the response output as PDF. I tried with the following code.


There was no error (or) Exception in Tomcat server. But the FireFox browser is saying

File does bor begin with '%PDF--';


Servlet Spec 2.4/ Jsp Spec 2.0/ JSTL Spec 1.1 - JSTL Tag Documentation
Ben Souther
Sheriff

Joined: Dec 11, 2004
Posts: 13410

To send the response as a pdf, you would first need to generate a PDF.
Try a Google search for "Apache FOP" or "itext" to find some libraries for generating PDFs.


Java API J2EE API Servlet Spec JSP Spec How to ask a question... Simple Servlet Examples jsonf
Vishnu Prakash
Ranch Hand

Joined: Nov 15, 2004
Posts: 1026
Thanks Ben
jiju ka
Ranch Hand

Joined: Oct 12, 2004
Posts: 306
Itext is memmory centric. If memmory is a constraint FOP is a beeter choice.
iText is easy to configure and use. For bigger applications FOP is prefered.

Another tool is FDF toolkit. Which also have limitations.
 
I’ve looked at a lot of different solutions, and in my humble opinion Aspose is the way to go. Here’s the link: http://aspose.com
 
subject: Response Output as PDF
 
It's not a secret anymore!