Last Updated: 14 Jun 2021 11:43 by ADMIN
Release R2 2021 SP1
Created on: 21 Nov 2017 15:47
Category: PdfProcessing
Type: Feature Request
PdfProcessing: Handle import of documents with invalid cross-reference table offsets
Current implementation relies on valid cross-reference offsets in the PDF documents so that PDF objects are easily found and parsed. However, we can implement a mechanism for repairing documents with invalid cross-reference tables.

The attached project shows how to repair the simplest case of cross-reference table by using RepairDocumentWithSimpleCrossReferenceTable method.
Posted on: 28 Jan 2020 13:46
Update: this workaround in my case works only with simple xref mismatch. If ther are more tables it cause errors even with wellformed documents.
Posted on: 21 Jan 2020 11:06

Thank you for the workaround. It worked for this error: 

Impossibile eseguire il cast di oggetti di tipo 'Telerik.Windows.Documents.Fixed.FormatProviders.Pdf.Model.Types.PdfInt' sul tipo 'Telerik.Windows.Documents.Fixed.FormatProviders.Pdf.Model.Types.IndirectObject'.

   in Telerik.Windows.Documents.Fixed.FormatProviders.Pdf.Import.Parser.PostScriptReader.Read[T](IPdfImportContext context, PdfElementType tokenType)
   in Telerik.Windows.Documents.Fixed.FormatProviders.Pdf.Model.Types.CrossReferenceCollection.ReadCrossReferenceStream(PostScriptReader reader, IPdfImportContext context)
   in Telerik.Windows.Documents.Fixed.FormatProviders.Pdf.Model.Types.CrossReferenceCollection.Read(PostScriptReader reader, IPdfImportContext context)
   in Telerik.Windows.Documents.Fixed.FormatProviders.Pdf.Import.BaseImportContext.PrepareCrossReferencesForImport()
   in Telerik.Windows.Documents.Fixed.FormatProviders.Pdf.Import.BaseImportContext.BeginImport(Stream pdfFileStream)
   in Telerik.Windows.Documents.Fixed.FormatProviders.Pdf.Streaming.PdfFileSource..ctor(Stream pdfFileStream, PdfImportSettings importSettings, Boolean leaveStreamOpen)
   in Telerik.Windows.Documents.Fixed.FormatProviders.Pdf.Streaming.PdfFileSource..ctor(Stream pdfFileStream)
   in TrkMWeb.Pdf.MergeDifferentDocumentsPages(String pathFSorgenti, String[] documentsToMerge, String pathFUnico, String resultFileName) in D:\Docs\Documents\Progetti\ModuliWeb\TrkMWeb\TrkMWeb\Pdf.cs:riga 55

Posted on: 19 Jun 2018 11:16
Thank you for sharing your feedback. Continue following this item, so you can be updated when its status changes.
Posted on: 13 Jun 2018 16:26
This would be great. Adobe Acrobat/Reader has this feature. Our users can get confused when a document like this opens in acrobat/reader but receive an error when being imported into an application using PDFProcessing. Obviously it is the document-in-need of repair's fault, but if there was a seamless solution that would make things easier.