This is a migrated thread and some comments may be shown as answers.

Import PDF exception

4 Answers 144 Views
PdfProcessing
This is a migrated thread and some comments may be shown as answers.
Egil
Top achievements
Rank 1
Egil asked on 23 Mar 2017, 12:07 PM

Hello,

I have the following code that loads a PDF :

byte[] file = File.ReadAllBytes(@"c:\big.pdf");
RadFixedDocument doc = null;
var prov = new PdfFormatProvider();
using (var input = new MemoryStream())
{
   input.Write(file, 0, file.Length);
   doc = prov.Import(input);
}

 

On import I am getting the following exception :

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

 

I attached the pdf used to this. Could you please let me know what the problem is? (Telerik version used is 2017.1.116.40)

Thank you.

4 Answers, 1 is accepted

Sort by
0
Tanya
Telerik team
answered on 24 Mar 2017, 09:51 AM
Hi Egil,

Please, note that the public forums allow only images as attachments to the posts.Because of this, I suggest that attaching the document you mentioned in your post has failed. Is it possible to upload the document somewhere and share a link in this thread?

If you would like, you can also contact us through our support ticketing system. The threads there are private and the system allows you to attach archive files.

Regards,
Tanya
Telerik by Progress

0
Egil
Top achievements
Rank 1
answered on 24 Mar 2017, 09:56 AM

Hello,

I added support ticket 1099941 for this.

Thank you

0
Tanya
Telerik team
answered on 24 Mar 2017, 05:58 PM
Hi Egil,

Thank you for submitting the support thread. I tested the document and replied in the ticket, so let's continue the conversation there for more consistency.

Regards,
Tanya
Telerik by Progress

0
Eric
Top achievements
Rank 1
Iron
answered on 11 Feb 2022, 02:05 PM

Hello,

I have the same probleme with a simple pdf who is generate by nuance software ...

Unable to cast object of type 'Telerik.Windows.Documents.Fixed.FormatProviders.Pdf.Model.Elements.DocumentStructure.PdfResource' to type 'Telerik.Windows.Documents.Fixed.FormatProviders.Pdf.Model.Types.PdfDictionary

 

my code is :

 PdfFormatProvider provider = new PdfFormatProvider();
            RadFixedDocument document = provider.Import(File.ReadAllBytes(InputFileWithInteractiveForms));

 

What can i do please ?

thank you

eric.muller@groupeadf.com

Tanya
Telerik team
commented on 16 Feb 2022, 09:29 AM

Hi Eric,

I can see that you had a discussion on that topic in another forum post and the issue has been resolved in newer versions of PdfProcessing. I am posting the link to the other thread for anyone who might encounter this question: https://www.telerik.com/forums/probleme-with-pdfprocessing-with-pdf-generate-by-nuance.

Hope this is useful.

Tags
PdfProcessing
Asked by
Egil
Top achievements
Rank 1
Answers by
Tanya
Telerik team
Egil
Top achievements
Rank 1
Eric
Top achievements
Rank 1
Iron
Share this question
or