We're sorry Aspose doesn't work properply without JavaScript enabled.

Free Support Forum - aspose.com

Body Height of word document


I want to insert an image as full page in a word document. The pages of the document have header and footer.
The height of the footer is dynamic; it changes depending on the text we displayed in.
To display the image, I have to specify its height that’s why I need to get the body height of the page. I mean the height without the height of the header and without the height of the footer.
I tried to calculate the body height using these methods:
BodyHeight = builder.PageSetup.PageHeight - (builder.PageSetup.FooterDistance + builder.PageSetup.HeaderDistance)
BodyHeight = builder.PageSetup.PageHeight -( builder.PageSetup.BottomMargin + builder.PageSetup.TopMargin)
But both methods give me wrong height value.

Do you have any other method to get the height of the page body?


Hi Sara,

Thanks for your inquiry. To ensure a timely and accurate response, please attach the following resources here for testing:

  • Your input Word document
  • Aspose.Words generated output document showing the undesired behavior
  • Your expected document which shows the correct output. Please create this document using Microsoft Word application

As soon as you get these pieces of information ready, we’ll start investigation into your issue and provide you code to achieve the same using Aspose.Words. Thanks for your cooperation.

PS: To attach these resources, please zip them and Click ‘Reply’ button that will bring you to the ‘reply page’ and there at the bottom you can include any attachments with that post by clicking the ‘Add/Update’ button.

Best regards,