You are missing ct.setYLine(20). If you are doing irregular columns it's advisable to also draw the walls (moveTo/lineTo) as a first debugging step. You may have the right wall at the left of the left wall.
> -----Original Message----- > From: [EMAIL PROTECTED] > [mailto:[EMAIL PROTECTED] On > Behalf Of Ilja Livenson > Sent: Monday, May 30, 2005 5:10 PM > To: Bruno Lowagie > Cc: [email protected] > Subject: Re: [iText-questions] using more complex area for paragraph > > Bruno Lowagie wrote: > > > Ilja Livenson wrote: > > > >> Hi, > >> > >> I'm kind of stuck with this problem: the document I'm doing has a > >> pretty complex form so I would really would like to > specify Polygon > >> (instead of Rectangle) for the form of the SimpleCell (which would > >> look like this: http://ilja.webmedia.ee/cell.gif ). Is it > possible at > >> all? Or is there some clever hack for achieving the same result? > > > > > > See http://itextdocs.lowagie.com/tutorial/objects/columns/ > > look for the word irregular. > > br, > > Bruno > > Hello, Bruno, > > thanks for your reply, but it seems I'm too dumb to understand how it > should work. For instance, why wouldn't the following > proof-of-concept work? > ---- > Document document = new Document(); > try { > PdfWriter writer = PdfWriter.getInstance(document, out); > document.open(); > PdfContentByte cb = writer.getDirectContent(); > ColumnText ct = new ColumnText(cb); > > float[] left = {10, 10, 20, 20}; > float[] right = {0, 0, 30, 30}; > > ct.addText(new Phrase("bla-bla bla-bla-bla-bla > bla-bla bla-bla > foo!\n", FontFactory.getFont(FontFactory.HELVETICA, 12))); > ct.setColumns(left, right); > ct.go(); > } > catch(DocumentException de) { > System.err.println(de.getMessage()); > } > catch(IOException ioe) { > System.err.println(ioe.getMessage()); > } > document.close(); > ---- > The compiler says that > ExceptionConverter: java.io.IOException: The document has no pages. > at com.lowagie.text.pdf.PdfPages.writePageTree(PdfPages.java:119) > at com.lowagie.text.pdf.PdfWriter.close(PdfWriter.java:1180) > at com.lowagie.text.pdf.PdfDocument.close(PdfDocument.java:934) > at com.lowagie.text.Document.close(Document.java:500) > > But why? Shouldn't the ct.go() flush the output to pdf? > Unfortunately, > I'm no export on pdf format so the last sentence could very well be > stupid :) > > Cheers, > Ilja > > > ------------------------------------------------------- > This SF.Net email is sponsored by Yahoo. > Introducing Yahoo! Search Developer Network - Create apps using Yahoo! > Search APIs Find out how you can build Yahoo! directly into your own > Applications - visit > http://developer.yahoo.net/?fr=offad-ysdn-ostg-q22005 > _______________________________________________ > iText-questions mailing list > [email protected] > https://lists.sourceforge.net/lists/listinfo/itext-questions > ------------------------------------------------------- This SF.Net email is sponsored by Yahoo. Introducing Yahoo! Search Developer Network - Create apps using Yahoo! Search APIs Find out how you can build Yahoo! directly into your own Applications - visit http://developer.yahoo.net/?fr=offad-ysdn-ostg-q22005 _______________________________________________ iText-questions mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/itext-questions
