This week's book giveaway is in the JDBC forum.
We're giving away four copies of Make it so: Java DB Connections & Transactions and have Marcho Behler on-line!
See this thread for details.
The moose likes Java in General and the fly likes FileWriter and PDF Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Make it so: Java DB Connections & Transactions this week in the JDBC forum!
JavaRanch » Java Forums » Java » Java in General
Bookmark "FileWriter and PDF" Watch "FileWriter and PDF" New topic

FileWriter and PDF

Gaelle SMITS

Joined: May 16, 2002
Posts: 23
Hi !
I am running a web application that has to create a pdf file from its binary flow.
Here's what I have done :
File ftest = new File("temp.pdf");
FileWriter fw = new FileWriter(ftest);
All this works perfectly... but when I call my PDF from a web browser, it doesn't start Acrobat Reader at all, but displays the binary flow.
How can I change this ?

Gaelle.<br />'Never forget to abuse of good things'
Balaji Loganathan
author and deputy

Joined: Jul 13, 2001
Posts: 3150
u can generate a PDF file like that,u have use either FOP or iText.
FOP is from apache
itext - search google.

Spritle Software Blogs
Bear Bibeault
Author and ninkuma

Joined: Jan 10, 2002
Posts: 63552

This actually has nothing to do with how the PDF is created, but rather how the browser is set up to handle various MIME types.
I recall seeing this very subject discussed in a previous thread (or perhaps threads).
"Use the search, Luke" and you should be able to locate the previous discussions.

[Asking smart questions] [About Bear] [Books by Bear]
I agree. Here's the link:
subject: FileWriter and PDF
It's not a secret anymore!