Free Support Forum -

Problem when applying header and footer from landscape to portrait mode


We are trying to update the header and footer of a document(UM.doc) in portrait from other document(891375_input.docx) which is in landscape mode. The header and footer in landscape mode is applied to the portrait mode. How do we shrink the header and footer to fit in Portrait mode.<?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" />

Here is the code snippet .

Document FP, Document UM;


// Restart the page numbering for the document to be appended.



FP.appendDocument(UM, ImportFormatMode.KEEP_SOURCE_FORMATTING);

891375_MR.docx is the result from the above code.

We tried the api’s provided in the below link

But it doesn’t seem to work for our problem.



Thanks for your request. As I can see, it is impossible to achieve even in MS Word. So, you have only one option. Disable inheriting Headers/Footers by the next section, clone headers/footer of previous section, insert them into the next section (replace existing if needed) and adjust width of table to fit window.

Best regards,

Can i get the api code you are referring to for adjusting the table width to fit the window. We tried to fit the cell width, but it was not working. Here is the code snippet we are using

Row rowN = footer.getTables().get.getFirstRow();



Hi Hari,

Thanks for your request. You can use built-in AutoFit method to achieve this. Please see the following link for more information:

Best regards,