This exception corrupts the whole document import. Instead, we should provide Exception handling mechanism which allows the user to import the rest of the content.
When importing document with predefined ToUnicode CMaps (e.g. Identity-H), an InvalidCastException is thrown with cause: Unable to cast object of type 'Telerik.Windows.Documents.Fixed.FormatProviders.Pdf.Model.Types.PdfName' to type 'Telerik.Windows.Documents.Fixed.FormatProviders.Pdf.Model.Elements.CMaps.ToUnicodeCMap'.
Currently this exception crashes the whole PDF document import. Instead we should simply skip the unsupported Action and import the rest of the PDF content correctly.
When importing a document containing an invalid PDF object dictionary key an exception is thrown.
This is reproducible with specific PDF files which use custom Encoding for the fonts of the field widgets. WORKAROUND: Change the font of VariableContentWidgets before editing the field value. You should additionally call RecalculateContent() method of these widgets if the value of their corresponding fields is not edited. The following method may be used for changing the font of all existing widgets in the document: private static void FixEncodingIssues(RadFixedDocument document) { foreach(Annotation annotation in document.Annotations) { VariableContentWidget widget = annotation as VariableContentWidget; if(widget != null) { widget.TextProperties.Font = FontsRepository.Helvetica; } } }