Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

FileWriter and PDF

Status
Not open for further replies.

Gaelle

Programmer
Jun 20, 2001
62
FR
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);
fw.write(strTemp);
fw.close();

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 ?

Thanks,
Gaelle.
 
well i'm not a superb programmer or so but what i do know is this. You make a file called temp.pdf, but in this case it doesn't matter what name you put in there. It could as well be temp.txt or whatever.whatever.

The problem that i see in here is that you think you create a .pdf file, but you are actually just creating a file with information in it. The temp.pdf you make has nothing to do with the .pdf standard.
You could just try to open a .pdf file that you already have in a text-editor to see that it does not contain just plain text :)

So i guess you will have to find some program that will convert the contents of temp.pdf into a real .pdf file.


good luck with it :)
i will keep watching this thread to learn from it myself.

greetz,
Krolsky

(please correct me if i'm wrong, i'm learning still :p)
 
Hi there !

Thanks to anyone that has helped me !
After all, I managed to have it working. In fact, my program was forgetting the first character of my binary flow, which was %, before %PDF1.2, and so PDF script wasn't interpreted.
It finaly works !
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top