logo       

Preformatting Text file--PDF: msg#00136

java.lib.itext.general

Subject: Preformatting Text file--PDF


Hi,

I am facing difficulties in converting a preformatted text file into PDF
I am using a paragraph with fixed font size,inspite of this the formatting
is not as exepected(not the same as in text file).

My code looks something like this.

PdfWriter.getInstance(document, new FileOutputStream("test.pdf"));
document.open();
InputStreamReader objInputStreamReader = new
InputStreamReader(fi);
BufferedReader objBufferedReader = new
BufferedReader(objInputStreamReader);
Font
times=FontFactory.getFont(FontFactory.TIMES_ROMAN, 7,Font.NORMAL,
new Color(0, 0, 255));
while((data=objBufferedReader.readLine())!=null){
document.add(new Paragraph(data, times));
}

i am trying to read a plain text file.

I have even tried using the method of creating a font and making use of
that..still the
formatting is not proper.Kindly let me know if there is any other way that i
can use to
format my PDF.

Thanks & Regards
Bruno
Nucleus Software Solutions
Ph: +65 62606878
Mail:bruno@xxxxxxxxxxxxxxxxxxxxxx




-------------------------------------------------------
This SF.net email is sponsored by: Etnus, makers of TotalView, The best
thread debugger on the planet. Designed with thread debugging features
you've never dreamed of, try TotalView 6 free at www.etnus.com.


<Prev in Thread] Current Thread [Next in Thread>
Google Custom Search

News | FAQ | advertise