Important Notice: Our web hosting provider recently started charging us for additional visits, which was unexpected. In response, we're seeking donations. Depending on the situation, we may explore different monetization options for our Community and Expert Contributors. It's crucial to provide more returns for their expertise and offer more Expert Validated Answers or AI Validated Answers. Learn more about our hosting issue here.

Can J2TextPrinter print RTF documents with embedded tables?

0
Posted

Can J2TextPrinter print RTF documents with embedded tables?

0

The current Java JTextPane implementation is not able to read RTF documents containing embedded tables. However, you can read in an RTF document without tables, and then use the method JTextPane.insertCompoent(JTable) to embed a JTable at a given position in the RTF document. However, if your JTable doesn’t fit on the page, it will not be paginated neatly on a JTable row boundary but rather on the calculated pixel boundary. A better approach is to use the J2FlowPrinter component of J2PrinterWorks to print the first part of your RTF in a J2TextPrinter instance, followed immediately by a J2TablePrinter instance for printing a JTable of any size (which will be paginated properly on row boundaries), followed immediately by more RTF in a second J2TextPrinter instance.

Related Questions

What is your question?

*Sadly, we had to bring back ads too. Hopefully more targeted.