----- Original Message ----- From: "Steve Appling" <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Friday, September 24, 2004 20:50 Subject: [iText-questions] MultiColumnText
> Ever since Christian Lauer posted some questions about adding ColumnText directly to a document, > I've been thinking about how I would want to use it. Last night I made a helper class > (MultiColumnText) that is an element and can be added to a document directly. It can handle regular > or irregular columns and can either have a fixed height or flow to fill each page until all of its > content is rendered. ColumnText is doing all the hard work underneath. > > To test it I made a random iText poem generator. This snippet shows how MultiColumnText is used: > // param is height, AUTOMATIC fills full pages until out of content > MultiColumnText mct = new MultiColumnText(MultiColumnText.AUTOMATIC); > > // params are left edge, right edge, gutter width, number of columns > mct.addRegularColumns(document.left(), document.right(), 10f, 3); > > for (int i=0; i<30; i++) { > mct.addElement(newPara(randomWord(noun), Element.ALIGN_MIDDLE, Font.BOLDITALIC)); > for (int j=0; j<4; j++ ) { > mct.addElement(newPara(poemLine(), Element.ALIGN_LEFT, Font.NORMAL)); > } > mct.addElement(newPara(randomWord(adverb), Element.ALIGN_LEFT, Font.NORMAL)); > mct.addElement(newPara("\n\n", Element.ALIGN_LEFT, Font.NORMAL)); > } > > document.add(mct); > > > Would anyone be interested in something like this? I'll be glad to contribute MultiColumnText or I'm interested. There's nothing to generate multicolumn out of the box. > enhance it if anyone thinks it is useful. I have attached the resulting iText poems for your > amusement (I'm apparently easily amused). I liked the line "drunken PdfPTable halts finally" (no > offense intended Paulo). > We can't avert fate... The truth is out there. Best Regards, Paulo Soares ------------------------------------------------------- This SF.Net email is sponsored by: YOU BE THE JUDGE. Be one of 170 Project Admins to receive an Apple iPod Mini FREE for your judgement on who ports your project to Linux PPC the best. Sponsored by IBM. Deadline: Sept. 24. Go here: http://sf.net/ppc_contest.php _______________________________________________ iText-questions mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/itext-questions