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

Error opening this pdf

3 Answers 64 Views
PDFViewer
This is a migrated thread and some comments may be shown as answers.
JC
Top achievements
Rank 1
JC asked on 18 Jan 2019, 09:01 AM

Hello,

I can't open this pdf with PdfDocumentSource

>> https://    ufile.io/    rkqtk

Here the full error : 

System.IndexOutOfRangeException: Index was outside the bounds of the array.<br>   at Telerik.Windows.Documents.Fixed.FormatProviders.Old.Pdf.PdfReader.Parsers.PdfParser.TryReadIndirectObject(Int64 offset, Boolean isEncrypted, IndirectObjectOld& indirectObject)<br>   at Telerik.Windows.Documents.Fixed.FormatProviders.Old.Pdf.PdfReader.Parsers.PdfParser.ReadCrossReferenceStream(Int64 offset, CrossReferenceStreamOld& stream, Byte[]& data)<br>   at Telerik.Windows.Documents.Fixed.FormatProviders.Old.Pdf.PdfReader.Parsers.PdfParser.InitTrailerAndCrossReferenceStream(Int64 offset)<br>   at Telerik.Windows.Documents.Fixed.FormatProviders.Old.Pdf.PdfReader.Parsers.PdfParser.ReadCrossReferenceCollection(Int64 offset)<br>   at Telerik.Windows.Documents.Fixed.FormatProviders.Old.Pdf.PdfReader.Parsers.PdfParser.InitializeCrossReferences()<br>   at Telerik.Windows.Documents.Fixed.FormatProviders.Old.Pdf.PdfReader.PdfContentManager..ctor(PdfFormatProvider provider, Stream stream)<br>   at Telerik.Windows.Documents.Fixed.FormatProviders.Pdf.PdfFormatProvider.Import()<br>   at Telerik.Windows.Documents.Fixed.PdfDocumentSource.CreateDocumentFromStreamOverride(Stream stream, FormatProviderSettings settings)<br>   at Telerik.Windows.Documents.Fixed.FixedDocumentStreamSource.CreateDocumentFromStream(Stream stream, FormatProviderSettings settings)

 

Thanks for your help :)

3 Answers, 1 is accepted

Sort by
0
JC
Top achievements
Rank 1
answered on 28 Jan 2019, 10:07 AM

No idea for me ?

 

0
Tanya
Telerik team
answered on 31 Jan 2019, 09:24 AM
Hi JC,

It seems like the file has some invalid byte offsets in its cross-reference table which are preventing RadPdfViewer from reading its content. According to the PDF file format specification, the cross-reference table is the point where the reading of the document content starts. When the offset defining the table is wrong, the format provider cannot find the starting point, thus it fails to import the document. What I can suggest to repair the document is to re-save it using Adobe Reader as it will automatically find the table when opening the file and replace the wrong value when saving it.

Hope this helps.

Regards,
Tanya
Progress Telerik
Get quickly onboarded and successful with your Telerik and/or Kendo UI products with the Virtual Classroom free technical training, available to all active customers. Learn More.
0
JC
Top achievements
Rank 1
answered on 11 Feb 2019, 05:13 PM

Thanks for your reply

But, as you may have noticed, the file opens well with Acobat Reader and others pdf tools

So, it seems that telerik lib will have to open it too no ?

For me it's a bug, but I understand that you don't want to fix it ...

Sincerly

Tags
PDFViewer
Asked by
JC
Top achievements
Rank 1
Answers by
JC
Top achievements
Rank 1
Tanya
Telerik team
Share this question
or