Error on pdf creation

Hello,
I’m having an issue when trying to save the attached docx files as a PDF and even try to save it once again as docx after the document creation. the initial issue seems to be that when creating the document, we’re trying to delete some structured document tags (<>, as shown in the attached doc), via Node.Remove() function. Tags are still there though in the resulting document.
It worked with previous versions (20.4). The error occured when we updated the version to 21.4. the issue also occurs with the new 22.2 version.

AsposeCase2 (2).docx (5.6 MB)

ErrorMessage:

A value with the specified key has already been added.

at . (Int32 , , Boolean )
at .VisitStructuredDocumentTagRangeStart(StructuredDocumentTagRangeStart )
at Aspose.Words.Markup.StructuredDocumentTagRangeStart.Accept(DocumentVisitor visitor)
at Aspose.Words.CompositeNode.AcceptChildren(DocumentVisitor visitor)
at Aspose.Words.CompositeNode.AcceptCore(DocumentVisitor visitor)
at Aspose.Words.CompositeNode.AcceptChildren(DocumentVisitor visitor)
at Aspose.Words.CompositeNode.AcceptCore(DocumentVisitor visitor)
at Aspose.Words.CompositeNode.AcceptChildren(DocumentVisitor visitor)
at Aspose.Words.CompositeNode.AcceptCore(DocumentVisitor visitor)
at .( ​ )
at .()
at Aspose.Words.Document.UpdatePageLayout()
at ​ . ​ ()
at ​ .( )
at ​ .( , )
at ​ .(Node )
at Aspose.Words.Document.UpdateFields()

@cternek We have reproduced and logged the issue as WORDSNET-23433. We will keep you informed and let you know once it has been resolved. We apologize for your inconvenience.
In order to improve the product and prevent similar errors in the future, please inform how the original document has been obtained. Has it been created manually in MS Word? What version? Or has it been created manually in another editor? What exactly? Has it been automatically generated by third party applications?

we’re using Aspose as part of our document creation process via our own word addin as well as a separate app designed for Dynamics crm. The error appears in both scenarios. We’re mainly using openxml but need Aspose.Words to make several adjustments to the document as well as to later save the created files as pdf’s. As I allready mentioned, some placeholders we are adding which will later be replaced via Aspose do not seem to be removed correctly within the document.xml. They are still there in the final document. when trying to save the file as a pdf it leads to that error. my word version is 2201 Build 16.0.14827.20180. but it does not seem to be related to a specific version, as we get the error in all of our scenarios, not only the word one.

@cternek Thank you for additional information. We will inform you within this forum thread as soon as we have more information.

Can you estimate how long this will take?

@cternek The code is in review stage now. If everything goes smoothly, the fix will be included in the next version of Aspose.Words, which will be released at the beginning of the next month.

Thanks for the update!

The issues you have found earlier (filed as WORDSNET-23433) have been fixed in this Aspose.Words for .NET 22.3 update also available on NuGet.