Hi,
I have an issue with getting document.TaggedContent of a output file created by concatenating few documents on disk.
I have 3 PDF files placed on disk, where all 3 files are openable, have a TaggedContent available and pdfFileEditor.TryConcatenate returns true, but when I try to retrieve the TaggedContent from the output document I receive the following exception:
“ArgumentException
An item with the same key has already been added.”
Here’s the code snippet:
var inputFiles = new List<string>() {
@"D:\TaggedContentIssue\0.pdf",
@"D:\TaggedContentIssue\1.pdf",
@"D:\TaggedContentIssue\2.pdf",
};
var license = new Aspose.Pdf.License();
license.SetLicense(@"Aspose.Total.lic");
var outputFile = @"D:\TaggedContentIssue\output.pdf";
var pdfFileEditor = new PdfFileEditor()
{
MergeDuplicateLayers = false,
CopyOutlines = true,
CopyLogicalStructure = true,
KeepActions = false
};
pdfFileEditor.TryConcatenate(inputFiles.ToArray(), outputFile).Dump();
var outputDoc = new Aspose.Pdf.Document(outputFile);
var taggedContent = outputDoc.TaggedContent;
I attach 3 PDF documents that I used to concatenate with Aspose. Notice that after changing order of the document the exception is not thrown, but unfortunately it is not an available solution for us.
Best regards,
Artur JeżowskiTaggedContentIssue.zip (771.4 KB)