Post a runnable example. Best Regards, Paulo Soares
----- Original Message ----- From: "amala kethineni" <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Tuesday, June 25, 2002 15:13 Subject: Re: [iText-questions] problem with space between the lines > > Let me explain my problem better. > > The first constructor creates 10 pages of output and > the second constructor is for legend and only produces > 1 page. My problem is with my first constructor. Only > the first page has correct leading and all subsequent > pages are having default leading though all the pages > are created with the same Paragraph constructor. Is > there any restriction that the paragraph should not > spill over to next page ? Since my paragraph is > producing 11 pages of output , is this a problem ? > > How do I make sure that all the pages within the > paragraph have same leading ? > > I appreciate all the help. > > Thanks, > bala > > > > --- Paulo Soares <[EMAIL PROTECTED]> wrote: > > If you don't create the Paragraph with the same > > constructor why would you > > expect to obtain the same results? Where's the > > explicit leading 8 in the > > second constructor? > > > > Best Regards, > > Paulo Soares > > > > ----- Original Message ----- > > From: "amala kethineni" <[EMAIL PROTECTED]> > > To: <[EMAIL PROTECTED]> > > Sent: Monday, June 24, 2002 16:48 > > Subject: [iText-questions] problem with space > > between the lines > > > > > > > Hi , > > > > > > I am creating a simple PDF document and my > > document > > > runs into 10 pages. I am using font size 8 and I > > want > > > the space between the lines as 8. With the code > > given > > > here , > > > the first page looks better with only 8 as > > leading > > > value but all other pages from 2 to 10 are > > defaulting > > > to 8x1.5=12 leading. What's wrong with this code ? > > > > > > > > > public ByteArrayOutputStream toPdf(StringBuffer > > > inBuffer, String headerBuffer, String > > footerBuffer, > > > String legendBuffer,boolean landscape) > > > { > > > //StringBuffer outBuffer = new > > StringBuffer(); > > > ByteArrayOutputStream outputStream = new > > > ByteArrayOutputStream(); > > > > > > // creation of the document with a certain size > > and > > > certain margins > > > Document document = null; > > > if (landscape) { > > > document = new > > > Document(PageSize.LETTER.rotate(), 5, 5, 5, 5); > > > } else { > > > document = new Document(PageSize.LETTER, 50, > > 50, > > > 50, 50); > > > } > > > > > > try { > > > // creation of the different writers > > > //PdfWriter.getInstance(document, new > > > FileOutputStream("text.pdf")); > > > PdfWriter.getInstance(document, outputStream); > > > > > > // Use courier font > > > Font standardFont = new Font(Font.COURIER, 8, > > > Font.NORMAL, new Color(0, 0, 0)); > > > > > > > > > // we add a Header that will show up on PAGE 1 > > > HeaderFooter header = new > > HeaderFooter(new > > > Phrase(headerBuffer), false); > > > document.setHeader(header); > > > > > > // we add a Footer that will show up on PAGE 2 > > > HeaderFooter footer = new > > HeaderFooter(new > > > Phrase(footerBuffer), true); > > > document.setFooter(footer); > > > > > > // Open the document for writing > > > document.open(); > > > > > > // Create a paragraph with our input > > > StringBuffer > > > > > > Paragraph paragraph = new Paragraph(8, > > > inBuffer.toString(), standardFont); > > > document.add(paragraph); > > > > > > // we reset the page numbering > > > document.resetPageCount(); > > > // we trigger a page break > > > document.newPage(); > > > // we add some more content > > > document.add(new > > > Paragraph(legendBuffer,standardFont)); > > > > > > } > > > // catch(DocumentException e) { > > > catch(Exception e) { > > > // We need to actually throw this message up > > ... > > > System.err.println(e.getMessage()); > > > } > > > > > > // Close the document > > > document.close(); > > > > > > return outputStream; > > > } > > > > > > > > > > > > Thanks, > > > bala > > > > > > > > > > > > > > > __________________________________________________ > > > Do You Yahoo!? > > > Yahoo! - Official partner of 2002 FIFA World Cup > > > http://fifaworldcup.yahoo.com > > > > > > > > > > > > ------------------------------------------------------- > > > Sponsored by: > > > ThinkGeek at http://www.ThinkGeek.com/ > > > _______________________________________________ > > > iText-questions mailing list > > > [EMAIL PROTECTED] > > > > > > https://lists.sourceforge.net/lists/listinfo/itext-questions > > > > > __________________________________________________ > Do You Yahoo!? > Yahoo! - Official partner of 2002 FIFA World Cup > http://fifaworldcup.yahoo.com > > > ------------------------------------------------------- > Sponsored by: > ThinkGeek at http://www.ThinkGeek.com/ > _______________________________________________ > iText-questions mailing list > [EMAIL PROTECTED] > https://lists.sourceforge.net/lists/listinfo/itext-questions ------------------------------------------------------- This sf.net email is sponsored by: Jabber Inc. Don't miss the IM event of the season | Special offer for OSDN members! JabberConf 2002, Aug. 20-22, Keystone, CO http://www.jabberconf.com/osdn _______________________________________________ iText-questions mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/itext-questions