Merge Documents with specific pages.

Hi,
I have a requirement when I merge word documents, I need to skip first or last page or both of source document. E.g I need to merge from pages 2 to 5 in a 6 page document to another document. Let me know whether this is possible using DocIO

1 Reply 1 reply marked as answer

HC Hemalatha Chiranjeevulu Syncfusion Team March 18, 2021 10:20 AM UTC

Hi Hemanath,

Thank you for contacting Syncfusion support.

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.

Essential DocIO is a non-UI component that provides a full-fledged document object model to manipulate the Word document contents. Hence currently it is not feasible to get the contents page by page in Word document using DocIO.

If your requirement is to selecting the particular content from Word document and merging into another Word document means, we suggest you use bookmark functionality in DocIO. To meet you requirement, we suggest you insert the bookmark start and bookmark end( which denotes the range of the content) in the source Word document. Using DocIO, you can retrieve the bookmark content from Word document using GetBookmarkContent() API. Then merge the content in destination Word document using DocIO.

Please refer the below UG documentation to know how to work with bookmark using DocIO.

https://help.syncfusion.com/file-formats/docio/working-with-bookmarks?cs-save-lang=1&cs-lang=csharp#retrieving-contents-within-a-bookmark
https://help.syncfusion.com/file-formats/docio/working-with-bookmarks

If the above solution doesn’t meet your requirement means, could you please share us the input Word document (with dummy content) and the expected output Word document which used at your end. Thereby, we will check on your requirement and provide the appropriate solution at the earliest.

Please let us know if you have any other questions.

Regards,
Hemalatha C


Marked as answer
Loader.
Up arrow icon