0

The functionality for the project that I am currently working is to get data from a WYSIWYG editor and convert all the input to a PDF document. The problem is sometimes there is necessary to add wider tables and this produces a truncated visualization of them.

To solve this problem, I added to the editor (specifically, CKEditor) a HR button but I renamed it to "Change page orientation", so users can click that before inserting a table. In Java, I used iText 7 to detect this element (<hr>) and change the page orientation. This works like a charm.

Example using iText with a simple table

Now, requirements changed and for license purposes we need to replace iText for another HTML to PDF converter, but we need to keep this functionality.

I found OpenHTMLToPdf and I liked it, but I didn't find the way to replicate this page orientation when a hr (or another specific element) is found.

How can I solve that? I can use whatever library as long as they are open source.

theraider
  • 1
  • 1
  • Hello @KJ, thanks for your reply! The article is an example, taken from [CKEditor](https://ckeditor.com/docs/ckeditor5/15.0.0/features/collaboration/comments/comments.html). This PDF was generated in an early test using CKEditor API to get the content. – theraider Jun 03 '21 at 16:03
  • Use Apache FOP and write the XSL to process the source HTML to XSL FO including your page requirements. – Kevin Brown Jun 03 '21 at 16:28

0 Answers0