Solved

output text into .PDF

Posted on 2001-07-04
6
179 Views
Last Modified: 2010-04-16
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
Comment
Question by:TLTEO
6 Comments
 
LVL 5

Accepted Solution

by:
mattyk earned 30 total points
ID: 6253453
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
 
LVL 3

Expert Comment

by:jerelw
ID: 6255807
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
 
LVL 18

Expert Comment

by:bobbit31
ID: 6256123
listening...
0
Highfive + Dolby Voice = No More Audio Complaints!

Poor audio quality is one of the top reasons people don’t use video conferencing. Get the crispest, clearest audio powered by Dolby Voice in every meeting. Highfive and Dolby Voice deliver the best video conferencing and audio experience for every meeting and every room.

 

Author Comment

by:TLTEO
ID: 6256558
OK what is the url to XML to pdf on the IBM site.

0
 
LVL 3

Expert Comment

by:jerelw
ID: 6257995
You have to register, but it's free.

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

0
 

Author Comment

by:TLTEO
ID: 6272035
Tks.  Thats  what I want.  A simpel way to output the text. Cheers
0

Featured Post

6 Surprising Benefits of Threat Intelligence

All sorts of threat intelligence is available on the web. Intelligence you can learn from, and use to anticipate and prepare for future attacks.

Join & Write a Comment

This was posted to the Netbeans forum a Feb, 2010 and I also sent it to Verisign. Who didn't help much in my struggles to get my application signed. ------------------------- Start The idea here is to target your cell phones with the correct…
In this post we will learn how to connect and configure Android Device (Smartphone etc.) with Android Studio. After that we will run a simple Hello World Program.
Viewers learn about the “for” loop and how it works in Java. By comparing it to the while loop learned before, viewers can make the transition easily. You will learn about the formatting of the for loop as we write a program that prints even numbers…
Viewers will learn about the different types of variables in Java and how to declare them. Decide the type of variable desired: Put the keyword corresponding to the type of variable in front of the variable name: Use the equal sign to assign a v…

758 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

21 Experts available now in Live!

Get 1:1 Help Now