Skip to Main Content

Java Programming

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Reading a PDF file as a String and creating another pdf file

807603Dec 18 2007 — edited Dec 25 2007
Hi,

I have a program that reads a pdf file and converts it into a string. i am supposed to write this string as a pdf file in another location.
When i write it, the file is not getting copied completely, most of the contents are missing. Please help me how to solve this problem.

I am using a FileInputStream to read the contents as bytes and convert it into a string and converting this string as bytes and writing it to a pdf file using FileOutputStream.

If i don't convert the bytes to string and directly write it to a pdf file, it works correctly. But i have a requirement to convert it to string to pass it to the server and store it as a pdf file in a location.

Thanks,
cmbl
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Jan 22 2008
Added on Dec 18 2007
12 comments
3,496 views