Unable to cast object of type 'Telerik.Windows.Documents.Fixed.FormatProviders.Pdf.Model.Types.PdfLiteralString' to type 'Telerik.Windows.Documents.Fixed.FormatProviders.Pdf.Model.Types.PdfName'.

1 Answer 57 Views
General Discussions PdfProcessing WordsProcessing ZipLibrary
Vaibhav
Top achievements
Rank 1
Iron
Iron
Vaibhav asked on 05 Dec 2024, 05:12 AM

firstly loading the document i have use 
  // Load the PDF document
  var provider = new PdfFormatProvider();
  var loadedDocument = provider.Import(inDocByte,null);

and after some functinality to export the document i have used below 

 Telerik.Documents.ImageUtils.ImagePropertiesResolver defaultImagePropertiesResolver = new Telerik.Documents.ImageUtils.ImagePropertiesResolver();
 Telerik.Windows.Documents.Extensibility.FixedExtensibilityManager.ImagePropertiesResolver = defaultImagePropertiesResolver;
 provider.Export(document, memoryStream, null);
 outDocPdf = memoryStream.ToArray();

what was the problem can you tell me the solution for that exception

Unable to cast object of type 'Telerik.Windows.Documents.Fixed.FormatProviders.Pdf.Model.Types.PdfLiteralString' to type 'Telerik.Windows.Documents.Fixed.FormatProviders.Pdf.Model.Types.PdfName'.

1 Answer, 1 is accepted

Sort by
0
Dess | Tech Support Engineer, Principal
Telerik team
answered on 09 Dec 2024, 10:32 AM

Hi, Vaibhav,

I am sorry to hear that you are experiencing any difficulties with RadPdfProcessing. 

Considering the title of this ticket, I would like to share that we had a similar error reported previously and a fix was introduced in Q3 2024. Here is the feedback item for your reference: PdfProcessing: InvalidCastException when importing a PDF document with embedded files. In case you are using an older version, I would highly encourage you to upgrade in order to benefit from the fix.

If the error occurs when importing a specific PDF document only, it is possible to be related to the internal content of the precise document. It is hard for us to investigate the issues without actually having the problematic file. Please try and prepare a sample file without the sensitive information. If you decide you can also submit a private support ticket from your Telerik account and send us the original file. You can be certain that it will be used only for investigation purposes of this case and your privacy will be respected.  

Thank you in advance for your cooperation. I am looking forward to your reply.

Regards,
Dess | Tech Support Engineer, Principal
Progress Telerik

Love the Telerik and Kendo UI products and believe more people should try them? Invite a fellow developer to become a Progress customer and each of you can get a $50 Amazon gift voucher.

Tags
General Discussions PdfProcessing WordsProcessing ZipLibrary
Asked by
Vaibhav
Top achievements
Rank 1
Iron
Iron
Answers by
Dess | Tech Support Engineer, Principal
Telerik team
Share this question
or