GAMBELLI Raffaele <r.gambelli <at> prismaeng.it> writes: > > In my work, I have also to provide both writing system, PDF and RTF. > In the beginning, I used for both the writers Table class. > I have many internal objects generated parsing a xml printing template, then I convert these objects in > Itext Element objects and I add them to the Document. > For header and Footer, I add them using a class which extends PdfPageEventHelper as you suggest in your > tutorial, I pass to my class my internal objects, it performs the covnersion betweent tables, then add the > PdfPTable to the document. > > Afterwards, when I decided to switch from Table to PdfPTable, inside onEndPage method I simply created a > method to convert a Table into a PdfPTable... > Perhaps didn't I understand the question? > > However I have two distinct classes that perform writing operation, PdfRenderer and RtfRenderer, each of > them knows how to convert my internal objects to Itext Element objects. In fact I have to gain the same > output with PDF and RTF and also with a document composed by java.awt.print.Printable objects. > > Best regards. > > P.S.: the book is finally arrived, but there isn't chapter about RTF sigh > sigh > > Raffaele
I'm passing around iText objects within my code. I've got, for example, PdfReportingStrategy, HtmlReportingStrategy, etc, and they write the document based on a List<Chapter> passed from my ReportingEngine object. I originally tried my own representation of the various iText components, but it was just an extra layer of abstraction that I didn't like, so I removed it. I may go ahead and create my own Table utility class that provides a table in a format required by the ultimate 'ReportingStrategy.' ------------------------------------------------------------------------- Take Surveys. Earn Cash. Influence the Future of IT Join SourceForge.net's Techsay panel and you'll get the chance to share your opinions on IT & business topics through brief surveys - and earn cash http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV _______________________________________________ iText-questions mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/itext-questions Buy the iText book: http://itext.ugent.be/itext-in-action/
