Hi, After googling some more I discovered that I was using an unsupported old version (unfortunately the newest version on Maven central, which is confusing).
So now I've tried this with iText 5.0.3 as well but I experience the same problem. Is what I'm trying to do unsupported, or is there a better approach for this layout requirement? Thanks in advance! BTW: The itextpdf.com maven repository was a little tricky to find ;-) Sonatype provides free Maven repositories for OSS projects, these repos can sync to the Maven central repository where most people expect to find the latest version of a library. https://docs.sonatype.org/display/Repository/Sonatype+OSS+Maven+Repository+Usage+Guide Kind regards, Jo Voordeckers On Thu, Aug 12, 2010 at 1:34 PM, Jo Voordeckers <[email protected]>wrote: > Hi Bruno and others, > > I'm sorry if this question has been answered before, but my searches in the > archive didn't reveal a solution. > > We have a document containing a few Paragraphs, containing Phrases, > PdfPTables and Images. > Depending on the content we want some paragraphs contained on the same > page. > Maybe we haven't chosen the ideal approach for this layout, if so please > advise a better solution. > > We're using iText 2.1.7 , the document structure is as follows: > > Document > Paragraph > PdfPTable > > If the Paragraph object has KeepTogether enabled the table is not rendered, > if this is false the table appears in the PDF. > > This is a minimal code snippet that reproduces the problem. > > Paragraph p1 = new Paragraph(); >> p1.setKeepTogether(false); >> p1.add(new Phrase("KeepTogether=FALSE")); >> >> Paragraph p2 = new Paragraph(); >> p2.setKeepTogether(true); >> p2.add(new Phrase("KeepTogether=TRUE")); >> >> PdfPTable t1 = new PdfPTable(2); >> t1.setWidths(new int[]{50,50}); >> t1.setWidthPercentage(100); >> PdfPCell c1 = new PdfPCell(new Phrase("Left")); >> c1.setHorizontalAlignment(PdfPCell.ALIGN_LEFT); >> PdfPCell c2 = new PdfPCell(new Phrase("Right")); >> c2.setHorizontalAlignment(PdfPCell.ALIGN_RIGHT); >> t1.addCell(c1); >> t1.addCell(c2); >> >> p1.add(t1); >> p2.add(t1); >> > > >> document.add(p1); >> document.add(p2); >> > > Thanks in advance! > > Kind regards, > > Jo Voordeckers > > -- > - Jo > -- - Jo
------------------------------------------------------------------------------ This SF.net email is sponsored by Make an app they can't live without Enter the BlackBerry Developer Challenge http://p.sf.net/sfu/RIM-dev2dev
_______________________________________________ iText-questions mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/itext-questions Buy the iText book: http://www.itextpdf.com/book/ Check the site with examples before you ask questions: http://www.1t3xt.info/examples/ You can also search the keywords list: http://1t3xt.info/tutorials/keywords/
