We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date

How to handle Error "Unexpected token ObjectStart before 24" when Loading PDF

Hi,
when Loading a specific Pdf created by stimulsoft-reports (attached) I get an unhandled Error called:
This is my StackTrace:
at Syncfusion.Pdf.IO.PdfParser.Error(ErrorType error, String additional)
at Syncfusion.Pdf.IO.PdfParser.Parse()
at Syncfusion.Pdf.IO.PdfParser.Parse(Int64 offset)
at Syncfusion.Pdf.IO.CrossTable.GetObject(IPdfPrimitive pointer)
at Syncfusion.Pdf.IO.PdfCrossTable.GetObject(IPdfPrimitive pointer)
at Syncfusion.Pdf.Primitives.PdfReferenceHolder.get_Index()
at Syncfusion.Pdf.Primitives.PdfReferenceHolder.GetObject()
at Syncfusion.Pdf.Primitives.PdfReferenceHolder.get_Object()
at Syncfusion.Pdf.IO.PdfCrossTable.Dereference(IPdfPrimitive obj)
at Syncfusion.Pdf.IO.PdfCrossTable.get_DocumentCatalog()
at Syncfusion.Pdf.Parsing.PdfLoadedDocument.GetCatalog()
at Syncfusion.Pdf.Parsing.PdfLoadedDocument.LoadDocument(Stream file)
at Syncfusion.Pdf.Parsing.PdfLoadedDocument..ctor(Stream file)
at Syncfusion.Pdf.Parsing.PdfLoadedDocument..ctor(Byte[] file)
at SyncfusionPDF.MainPage.d__5.MoveNext()
a test-pdf I got fromhttp://www.orimi.com/pdf-test.pdf was processed fine
what is the reason for this error, since it can't come from code?

Attachment: test_eef798b7.zip

3 Replies

SK Sasi Kumar Sekar Syncfusion Team September 20, 2016 12:18 PM UTC

Hi Raymond, 

Thank you for contacting Syncfusion support, 

We confirmed that the issue with unexpected token object start before 24 is a defect and we logged a defect report. The fix for the patch will be available in our Essential studio volume 3 service pack 1, 2016 release. 

Please let us know If you have any concern on this.  

Regards, 
Sasi Kumar S. 



RO Raymond Osterbrink February 2, 2018 01:43 PM UTC

Hello,
My Request is 17 month old, I'm using the recent release Version 15.4460.0.20 still, this problem is not fixed. I'm quiet disapointed.
Regards 


SL Sowmiya Loganathan Syncfusion Team February 5, 2018 09:50 AM UTC

Hi Raymond, 

The patch for the issue “Unexpected token object start before 24 when loading the document” has been already included in the product version 15.4460.0.20( volume 3 service pack 1, 2016 release).  
 
Since the previously provided document is corrupted, we should load the document with OpenAndRepair parameter, please refer below snippet for your reference. 
 
PdfLoadedDocument document = new PdfLoadedDocument(docStream, true); 


Note: The OpenAndRepair overload is capable of resolving basic cross reference offset issues and cannot repair complex document corruption. 

Please let us know if you need any further assistance. 

Regards, 
Sowmiya L 


Loader.
Up arrow icon