Hello!
merging two RTF files in one and then converting it causes this exception
‘A value with the specified key has already been added’.
Current version is 21.3.0.0.
Can found attached 3 files. 2 files and the third one is the result of merging.
aspose.7z (456.6 KB)
Thanks in advance
@enricoV Thank you for reporting the problem to us. I have managed to reproduce the problem with SEZ01.rtf
document on my side. It has been logged as WORDSNET-24028. We will keep you informed and let you know once it is resolved.
Also, I tested merging your source RTF documents using the latest version of Aspose.Words and the output RTF can be successfully converted to PDF:
// Merge RTF documents
Document doc1 = new Document(@"C:\Temp\1.DOC-2.rtf");
Document doc2 = new Document(@"C:\Temp\1.DOC-3.rtf");
doc1.AppendDocument(doc2, ImportFormatMode.KeepSourceFormatting);
doc1.Save(@"C:\Temp\out.rtf");
// Convert the merged document to PDF
Document doc = new Document(@"C:\Temp\out.rtf");
doc.Save(@"C:\Temp\out.pdf");
Could you please share the code that produces the problematic RTF document for our investigation?
The issues you have found earlier (filed as WORDSNET-24028) have been fixed in this Aspose.Words for .NET 22.8 update also available on NuGet.