Currently, I am converting XHTML to pdf using XSLT via Apache FOP lib where page layout and margins are defined in XSLT. I want a 100% similar Docx output as the pdf. So, I want to reuse the current XSLT file for rendering the XHTML into Docx. FYI, I am using JAVA.
For XHTML to Docx conversion currently, I am using Docx4j's XHTMLImporterImpl, but there are some differences in generated Docx file and pdf generated with the same XHTML via Apache FOP.
1. Generated pdf is 2 pages, but generated Docx is of 3 pages.
2. Tables column's widths and heights are different in pdf and Docx.