Loading PDF throws exception "Invalid cross reference table".

Hi.

I am using the Winforms Syncfusion.Windows.Forms.PdfViewer.PdfDocumentView Control to show PDF files. To load the file, I use the Syncfusion.Pdf.Parsing.PdfLoadedDocument to load its binaries first, and then I use it as the argument for the viewer. This works just fine in my Dev machine. However, it doesn't work in any other machine where the application is deployed.

I have added references to and am distributing the following DLLs:
Syncfusion.Pdf.Base
Syncfusion.PdfViewer.Windows
Syncfusion.Shared.Base

The Exception I get is:

PdfException
  Invalid cross reference table.

Source     : Syncfusion.Pdf.Base

Stack Trace: 

   at Syncfusion.Pdf.Parsing.PdfLoadedDocument.LoadDocument(Stream file)
   at Syncfusion.Pdf.Parsing.PdfLoadedDocument..ctor(Stream file)
   at Syncfusion.Windows.Forms.PdfViewer.PdfDocumentView.Load(Stream stream)

I have attached the offending file.

Would you guys have any word of advice on how to avoid this?

Thanks in advance.

Ivan



Attachment: Test_5a5ddbe6.7z

6 Replies 1 reply marked as answer

DG Deepak Gunasekaran Syncfusion Team September 16, 2020 06:30 PM UTC

Hi Ivan, 

Thank you for sharing the details. 

We have tried to reproduce the reported issue with the given document and the details provided, but we are unable to reproduce it in our end. We have tried with the latest version of PdfViewer 18.2.0.44 and the sample that we have used for reproducing the issue can be downloaded from the following location. 

We suspect that this could be version related issue which is installed in your machine and the other machines which you have installed. You can use the sample in your end or modify the sample to reproduce the issue and provide us for further analysis.  

If you still facing the issue, please provide us the following details that will be helpful for us to investigate more on this and provide you a better solution. 
  
1.       Essential studio version installed [in your machine and the other machines in which you faced the issue]: 
2.       Operating System details [of the machine in which the issue is reproduced] 
3.       .Net framework used. 
  
Regards, 
Deepak G 



IB Ivan Borges September 16, 2020 08:53 PM UTC

Hi Deepak.

Thank you so much for your attention to this.

Sorry for not supplying further information on my environment, I should have known better. :-)
  1. I am using the same Essential Studio Version (18.2400.0.44). 
  2. The Operating System where I have the issues currently is Windows Server 2012. Don't have Syncfusion installed on this machine. I have only the Executables and the necessary DLLs.
  3. But then, the runtime is for v4.0.30319. I have installed the AddOns since I need to stay on .NET 4.0.
I have run your sample on the machine where I get the error and it runs fine, no error whatsoever. So I guess you are probably right, maybe it is the AddOn version of Syncfusion causing this, since in my Dev machine, where I don't get the error, I have the full Syncfusion installed.

If you need any further information to investigate this or would like me to try anything on my side, please just let me know.

Thank you so much.

Ivan



DG Deepak Gunasekaran Syncfusion Team September 17, 2020 05:14 PM UTC

Hi Ivan, 
 
Thank you for sharing more details which will help us to investigate further on this.  
 
We are currently working on to reproduce the reported issue with the details provided. We will update you the further details on 21st September 2020. 
 
Regards, 
Deepak G 



IB Ivan Borges September 17, 2020 05:17 PM UTC

Thank you Deepak.
I will be anxiously waiting. :-)




DG Deepak Gunasekaran Syncfusion Team September 21, 2020 06:15 PM UTC

Hi Ivan, 
 
Thank you for your patience. 
 
We could reproduce the issue with the AddOn WinForms sample in the Syncfusion not installed machine. After analyzed further on this, we could see that this issue is occurred due to the assembly “Syncfusion.Compression.Base” is missed to refer in the sample. It is a dependent assembly of Syncfusion.Pdf.Base. It should be referred in the application, if running in the machine in which Syncfusion is not installed. Please find the dependency details in the following link: 
If Syncfusion is installed, it refers in the Syncfuson.Pdf.Base automatically from the GAC, which will be installed in the machine when installing Syncfusion Essential Studio. 
 
Kindly add the Syncfusion.Compression.Base reference in the project to overcome the issue and let us know if you need any further assistance. 
 
Regards, 
Deepak G 


Marked as answer

IB Ivan Borges September 21, 2020 09:52 PM UTC

Hi Deepak.

Thank you for your attention.

You nailed it. I added the DLL to the distribution package and all is working fine now.

Cheers!

Ivan


Loader.
Up arrow icon