I am trying to convert docx to pdf using the docx4j api :
- Code: Select all
Docx4J.toPDF(wordPorcessingMLPackage, os);
But the issue I am facing is that, I have implemented docx shapes as per wps standards and while converting docx to pdf , <mc: choice> is getting ignored. It goes to fallback block. The xml is of the following structure:
- Code: Select all
<mc:AlternateContent>
<mc:Choice Requires="wps">
<w:drawing>.....
</w:drawing>
</mc:Choice>
<mc:Fallback>
I inspected the foSettings.xml but found that wps namespace is missing in the <fo:root>, as shown below
- Code: Select all
<fo:root xmlns:fo="http://www.w3.org/1999/XSL/Format" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006">
How will I be able to get wps enabled in the fo settings file? Am I missing anything?
Please provide your inputs.
Thanks & Regards,
Prachi