I'm using this code to convert an XWPFDocument
to PDF
:
ByteArrayOutputStream baos = new ByteArrayOutputStream();
PdfOptions options = PdfOptions.create();
PdfConverter.getInstance().convert(xwpfDocument, baos, options);
The converter is setting wrong margins on the pdf. Here is the original .docx
:
And this is the pdf
after conversion:
How can I retain the original left and right margins?