PdfProcessing: InvalidCastException when importing a document
System.InvalidCastException: 'Unable to cast object of type 'Telerik.Windows.Documents.Fixed.FormatProviders.Pdf.Model.Types.PdfStream' to type 'Telerik.Windows.Documents.Fixed.FormatProviders.Pdf.Model.Elements.MarkedContents.ReferencedObject'.'
1 comment
ADMIN
Dess | Tech Support Engineer, Principal
Posted on:26 Mar 2026 15:42
Hello,
Once the item is marked as Completed, a new exception type will be introduced. This would allow to continue processing the document import operation:
provider.ImportSettings.DocumentUnhandledException += (s, args) =>
{
if (args.Exception is InvalidStructureTreeException)
{
args.Handled = true; // Mark the exception as handled to continue processing.
}
};
Regards,
Dess | Tech Support Engineer, Principal
Progress Telerik