Results 1 to 1 of 1
- 05-13-2011, 08:58 PM #1
Member
- Join Date
- Feb 2008
- Posts
- 60
- Rep Power
- 0
Can we set max line length, using iText library?
Hello all,
I am using iText java libraries to convert .txt files to PDF. The following is my code: My text file has lines which are longer, and when I convert to PDF, the lines get wrapped. Is there a way that I can set max line length? Please advise...
Java Code:public static void main(String[] args) { try { Document document = new Document(); PdfWriter.getInstance(document, new FileOutputStream("C:\\input.pdf")); document.open(); String input = "C:\\input.txt"; BufferedReader in = new BufferedReader(new FileReader(input)); String str; boolean hasPage = false; while ((str = in.readLine()) != null) { document.add(new Paragraph(str)); hasPage = true; } if (hasPage) { document.close(); } in.close(); }catch (Exception e) { e.printStackTrace(); }
Similar Threads
-
generate pdf in servlet using itext library
By shihad_s in forum New To JavaReplies: 2Last Post: 01-25-2011, 11:48 AM -
Maximum length of Command Line Argument
By balamurugan.murthy in forum Advanced JavaReplies: 11Last Post: 05-21-2010, 04:45 PM -
Itext
By anilhk@gmail.com in forum Advanced JavaReplies: 0Last Post: 04-14-2010, 05:03 AM -
I want to put the native library in library path in mac os x
By Hussain Ali in forum Advanced JavaReplies: 2Last Post: 02-24-2010, 07:55 AM -
Tell me jar file for library library org.bouncycastle.cms
By 82rathi.angara in forum New To JavaReplies: 10Last Post: 09-09-2008, 05:11 AM


LinkBack URL
About LinkBacks
Reply With Quote
Bookmarks