Merging Documents with DocIO Knowing Remaining Space Before Adding a Document

Hi everyone,

I am currently working with DocIO to merge several documents into one. My goal is to ensure a clean and coherent layout, avoiding the situation where the content of the last merged document gets split between two pages.

To achieve this, I would like to know if it is possible to determine the remaining space in the final document before merging the last document. The idea is to add a page break if the available space is insufficient, ensuring that the content of the last document does not get fragmented.

Has anyone encountered this issue before or have any suggestions on how to proceed? Any help or pointers would be greatly appreciated.

Thank you in advance for your responses and assistance!


1 Reply

DS Dharanya Sakthivel Syncfusion Team May 31, 2024 12:10 PM UTC

Hi Chaffois,

The Word document is a flow document in which contents will not be preserved page by page; instead, the contents will be preserved sequentially section by section. Each section may extend to various pages based on its contents like table, text, images etc.

Word viewer/editor renders the contents of the Word document page by page dynamically when opened for viewing or editing and this page wise rendered information will not be preserved in the document level as per the Word file format specification.

Whereas Syncfusion DocIO is a non-UI component that provides a full-fledged document object model to manipulate the Word document contents. Hence, it is not feasible to know the remaining space in a page before merging another document using DocIO.

Please refer to the below KB article which explains the same:
https://support.syncfusion.com/kb/article/4241/why-it-is-not-possible-to-access-the-word-document-contents-page-by-page


Regard,
Dharanya.



Loader.
Up arrow icon