Go Premium for a chance to win a PS4. Enter to Win

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 208
  • Last Modified:

output text into .PDF

Hi  there

I know that we can use codes like

PrintWriter out = new PrintWriter(new FileWriter("C:\\Program Files\\myfiles\\outputfile.txt");
out.println(buf.toString());

this si to write some text into a file


If I want to write the output into a pdf file,  any chnace how to so it??


0
TLTEO
Asked:
TLTEO
1 Solution
 
mattykCommented:
Here's a great article on this topic
http://softwaredev.earthweb.com/java/article/0,,12082_626501,00.html

it works with the API available at
http://www.etymon.com/pj/index.html


There are several API's availalbe out there to do this too

http://sourceforge.net/projects/reteppdf/
http://www.lowagie.com/iText/
http://sourceforge.net/projects/gnujpdf/

-matty
0
 
jerelwCommented:
Why not have your code output XML and then stream out the desired format by applying a stylesheet?

Should you decide to output to a different format like csv, html, svg, etc, the foundation is already set.

There is a free XSL course that demonstrates XML to pdf on the IBM site.

It might be worth the time to spend the effort in making your code able to output to any format with minimal code changes.

It looks like your going to spend time learning the pdf API's anyway...
0
 
bobbit31Commented:
listening...
0
Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
TLTEOAuthor Commented:
OK what is the url to XML to pdf on the IBM site.

0
 
jerelwCommented:
You have to register, but it's free.

http://www6.software.ibm.com/reg/xml/transformxml-i

0
 
TLTEOAuthor Commented:
Tks.  Thats  what I want.  A simpel way to output the text. Cheers
0

Featured Post

Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now