I need to know the header (on that very page) distance along with the page height for all pages in the DOCX. Just curios, how can I achieve this goal efficiently?
Please consider the fact that subsequent pages could have different orientations, while providing the solution.
Page Header-distance Page-height
1 2 10 (portrait)
2 3 8 (landscape, section 2 if you will and first page header)
3 3.5 8 (landscape, section 2 but odd page header which has different height)
Actual need is also to find footer distance but assuming if we can get header distance, there could be the way for footer distance as well.
Thanks for your inquiry.
PageSetup.HeaderDistance property returns or sets the distance (in points) between the header and the top of the page.
PageSetup.FooterDistance property returns or sets the distance (in points) between the footer and the bottom of the page.
PageSetup.PageHeight property returns or sets the height of the page in points.
PageSetup.PageWidth property returns or sets the width of the page in points.
If you still face problem, please share your input document here for our reference. We will then provide you more information on this along with code.
Moreover, please check the .NET code examples shared in following forum link for your kind reference.
Thanks for your help. I saw all that DocumentSplitter way yesterday itself while searching the forums, and I believed that there could be a easier way for doing so and moreover that code was throwing some exceptions while in use, which I then decided not to look more.
Thanks for your feedback. It is nice if you have found the solution of your query. If you still face problem, please share some more detail about your query along with input document and expected values of header/footer distance and page height. We will then provide you more information about your query along with code.