I am merging 3 docx files into 1 and then converting it to pdf.
Whilst adding a header and footer (objects retrieved from other docx files) into the body i set the following:
headerReference.setType(HdrFtrRef.DEFAULT); // FIRST / DEFAULT / EVEN
footerReference.setType(HdrFtrRef.DEFAULT); // FIRST / DEFAULT / EVEN
SectPr sectPr = objectFactory.createSectPr();
because the body i am merging the header and footer into already has a SectPr.
When i use DEFAULT the resulting merged docx file looks fine meaning that page 1 and page 2 contents are on their own pages like the body was before merge and the header and footer display on all the pages. The resulting PDF file however is on one page and the header and only half footer are displayed.
If i use FIRST or EVEN then the header and footer do not show in office when you open the merged word document (no error messages pop up and i dont see any conflicting rId's in the xml either) and the resulting PDF is all on one page again and it does contain the header and half the footer again.
Has anyone run into a problem where the docx looks fine but pdf cuts off the footer?
has anyone encountered the problem i am having with type as FIRST or even where the merged doc does not show the header or footer but the converted PDF does indeed show it but half of its contents?
Thanks in advance