I am using Aspose.Words.jdk16.jar creating RTF files and able to render Header/Footer and tables with dynamic values easily. Right now, I have a new requirement that is, to render the same content to PDF file too.
I used this Aspose.Words.jdk16.jar and tried to save the same content (Dynamic Header and Footer and Dynamic Tables) as .pdf file. But the alignment is not same as RTF.
Can any one suggest me on “How can I retain the same Formatting (Tables and Page Setup and alignment) in PDF file” using the above jar.
Please provide if you have any java code to read and write the same formatting into PDF file.
Thank you for your reply.
Attached is the sample .pdf file generated.
I tried 2 methods.
1. Generate .pdf file using doc.save(.pdf).
2. Generate .rtf file using doc.save(.rtf) and open the same .rtf docuemnt using document object and save it using doc.save(*.pdf).
In both the cases the .pdf file formatting and alignment is lost.
I have also attached the .rtf file generated for your reference (Alignment and formatting is fine).
Request you check on this and give your inputs.
Thank you Awais for your reply.
Based on your last post, I understand that, it is not possible to render the RTF formatting into PDF formatting right now.
Could you please let me know what is the workaround so that, I can accomplish my task.
Thank you Awais for the information.
It is partially working after invoking Document.updateTableLayout() method that is, the body part of the document is rendered properly but, the header and footer section of the document is not displayed as expected.
Could you suggest, “Is there any other method should I call to render the header and footer section properly”.