MergeWithDocument dealing with proper destination of the StructureRoot elements

Posted by: graciela.magana on 16 June 2023, 3:19 pm EST

  • Posted 16 June 2023, 3:19 pm EST - Updated 16 June 2023, 3:24 pm EST

    Hello, I have been working with merging two documents with one page each into one and writing on top of the second document’s page. I have this case were we are trying to make the documents accessible so we are creating elements in the structureRoot for the page of the first document and a structureRoot for the page of the second document.

    var doc2 = new GcPdfDocument(license);
    doc2.Load(stream);
    
    doc.MergeWithDocument(bNDoc, new MergeDocumentOptions()
    {
    	PagesRange = new OutputRange(1, 1),
    	MergeStructTree = true,
    	DestinationStructElements = doc.StructTreeRoot.Children
     });
    
    doc.MarkInfo.Marked = true;
    doc.Save(stream);

    I keep getting the tag that came from doc2 as the first part of the second page instead of getting it at the end after the part with a section and table inside of it (please refer to attachment). I’m trying to see if there is any way that I can specify the index of the tag or exact position it should go inside the structureRoot children of the parent merge.

    Is there any documentation detailing more on how to use DestinationStructElements or a way to specify where in the structureRoot I want the tags coming from the other document to land?

  • Posted 20 June 2023, 8:34 am EST

    Hi,

    Could you please share a sample pdf file that you are merging so that we could also replicate the issue at our end and investigate it further? You may replace the confidential data with some dummy data or may share the files in our private support portal by creating a support case.

    Regards,

    Avinash

Need extra support?

Upgrade your support plan and get personal unlimited phone support with our customer engagement team

Learn More

Forum Channels