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. (Last updated on: November 16, 2018).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

When I open pdf file I get crash

Thread ID:

Created:

Updated:

Platform:

Replies:

116169 Apr 16,2014 09:50 PM UTC Jul 17,2017 04:22 PM UTC WinRT 14
loading
Tags: SfPdfViewer
Vadim Makutin
Asked On April 16, 2014 09:50 PM UTC

Could you help me to figure out what I do wrong.
When I open pdf file from byte array I get System.ArgumentNullException.

My code:
byte[] data = await GetPDF("sample.pdf");
var pdfLoadedDocument = new PdfLoadedDocument(data);                    
pdfViewer.LoadDocument(pdfLoadedDocument);
-------------------------------------
Exception:
System.ArgumentNullException: Value cannot be null.
Parameter name: crossTable
   at Syncfusion.Pdf.Parsing.PdfLoadedPageCollection..ctor(PdfDocumentBase document, PdfCrossTable crossTable)
   at Syncfusion.Pdf.Parsing.PdfLoadedDocument.get_Pages()
   at Syncfusion.Pdf.Parsing.PdfLoadedDocument.get_PageCount()
   at Syncfusion.Windows.PdfViewer.PdfDocumentView.set_LoadedDocument(PdfLoadedDocument value)
   at Syncfusion.Windows.PdfViewer.SfPdfViewerControl.LoadDocument(PdfLoadedDocument loadedDocument


Note: 
Syncfusion.SfPdfViewer.WinRT (version: 12.1810.0.43)
Syncfusion.Pdf.WinRT (version 12.1810.0.43)

Vadim Makutin
Replied On April 17, 2014 04:12 AM UTC

this problem occurs when I open pdf file from database. if I open file from local folder it works perfect.

Suresh M [Syncfusion]
Replied On April 21, 2014 06:29 AM UTC

Hi Vadim,

 

Thank you for using Syncfusion products.

 

We are not able to reproduce the issue “ArgumentNull exception is thrown when loading PDF stream to the viewer”. Please find the sample available in the link below with which we tried to reproduce the issue. Please modify this sample or provide us a new sample with which the issue could be reproduced, this would be more helpful for us to further investigate on this.

 

Sample: http://www.syncfusion.com/downloads/support/directtrac/123816/PDFViewerWintRT_20132129551588.zip

 

Please let us know if you need any further assistance.

 

Thanks,

Suresh 


Sébastien Lachance
Replied On April 24, 2014 12:39 AM UTC

Hello Suresh,

I was helping my colleague this afternoon.

There is clearly a bug in the PDF Viewer. I was not able to access your sample project, because it has some protection when I click on the file. However, Vadim told me he was not able to reproduce it previously.

Anyway, our code is very simple:

var pdfLoadedDocument = new PdfLoadedDocument(data);
pdfViewer.LoadDocument(pdfLoadedDocument);

This code generates a 100% crash on our side.

I dig around the pdfViewer methods and I found the undocumented method pdfLoadedDocument.OpenAsync. I tried this method and it starts to work well.

1- Could you take a look on your source code to tell us what is the difference between passing the buffer to the constructor or the OpenAsync method please?

2- For PDF bigger than 4 MB, the performance is not good. It would be nice to display a progress ring when the PDF is loading. The problem is there is no event to tell us when the PDF is done loading. Am I wrong? Can you add an event?

Thank you
Sébastien


Suresh M [Syncfusion]
Replied On April 28, 2014 10:43 AM UTC

Hello Suresh,

I was helping my colleague this afternoon.

There is clearly a bug in the PDF Viewer. I was not able to access your sample project, because it has some protection when I click on the file. However, Vadim told me he was not able to reproduce it previously.

Anyway, our code is very simple:

var pdfLoadedDocument = new PdfLoadedDocument(data);
pdfViewer.LoadDocument(pdfLoadedDocument);

This code generates a 100% crash on our side.

I dig around the pdfViewer methods and I found the undocumented method pdfLoadedDocument.OpenAsync. I tried this method and it starts to work well.

1- Could you take a look on your source code to tell us what is the difference between passing the buffer to the constructor or the OpenAsync method please?

2- For PDF bigger than 4 MB, the performance is not good. It would be nice to display a progress ring when the PDF is loading. The problem is there is no event to tell us when the PDF is done loading. Am I wrong? Can you add an event?

Thank you
Sébastien


Hi Sébastien,

 

Thank you for your interest in Syncfusion products.

 

We are not able to reproduce the issue mentioned in the incident. Please find the sample available in the link below with which we tried to reproduce the issue. Please modify this sample or provide us a new sample with which this issue could be reproduced. This will help us to further investigate on thi.

 

Sample: http://www.syncfusion.com/downloads/support/directtrac/124249/PDFViewerWintRT_2013-567023171.zip

 

Please let us know if you need any further assistance.

 

Thanks,

Suresh


Sébastien Lachance
Replied On April 28, 2014 01:16 PM UTC

Hello,

I asked 2 questions and you replied something unrevelant.

Could you please answers my two questions?

Thank you
Sebastien


Suresh M [Syncfusion]
Replied On April 29, 2014 05:02 AM UTC

Hi Sébastien,

 

We apologize for the inconvenience.

 

1- Could you take a look on your source code to tell us what is the difference between passing the buffer to the constructor or the OpenAsync method please?

Passing the buffer to the constructor and the OpenAsync method does the same process, whereas OpenAsync is asynchronous which helps the UI to be responsive. The documentation of loading a PDF document is available in the link http://help.syncfusion.com/UG/winrt/default.htm#!Documents/loaddocument.htm

 

2- For PDF bigger than 4 MB, the performance is not good. It would be nice to display a progress ring when the PDF is loading. The problem is there is no event to tell us when the PDF is done loading. Am I wrong? Can you add an event?

For displaying larger PDF documents in the PDF viewer, we initially display a blurred image of the page of the PDF document, then followed by displaying the actual page. We have logged a feature request report for adding an event to get the status of the page render process. Please follow up the implementation of the feature with the Direct Trac incident http://www.syncfusion.com/support/directtrac/incidents/124313

 

 

Regarding the issue mentioned “Loading the buffer into PDF document and loading it into Viewer crashes”, we are not able to reproduce the issue mentioned in the incident. Please find the sample available in the link below with which we tried to reproduce the issue. Please modify this sample or provide us a new sample with which this issue could be reproduced. This will help us to further investigate on this.

 

Sample: http://www.syncfusion.com/downloads/support/directtrac/124249/PDFViewerWintRT_2013-567023171.zip

 

Please let us know if you need any further assistance.

 

Thanks,

Suresh


Sébastien Lachance
Replied On April 30, 2014 01:26 PM UTC

Hi,

In a little sample, I'm not able to reproduce the crash. The story must be different in a real world application.

It is a 100% crash repro when I'm using the constructor.

I would be able to help if I get the .pdb or the Syncfusion code to show you exactly where it crash. We already provided a release output.

Could it be possible to get the pdb or code? I'm also available to a remote session using Team Viewer if you want to see the crash in real-time.

Thank You
Sébastien


Suresh M [Syncfusion]
Replied On May 7, 2014 08:48 AM UTC

Hi,

In a little sample, I'm not able to reproduce the crash. The story must be different in a real world application.

It is a 100% crash repro when I'm using the constructor.

I would be able to help if I get the .pdb or the Syncfusion code to show you exactly where it crash. We already provided a release output.

Could it be possible to get the pdb or code? I'm also available to a remote session using Team Viewer if you want to see the crash in real-time.

Thank You
Sébastien


Hi Sébastien ,

 

Thank you for your response,

 

We provide the source code only to our customers who has the source code license. Please follow up with the Direct Trac incident #124313, for organizing a web meeting to illustrate this issue.

 

Please let us know if you need any further assistance.

 

Thanks,

Suresh


Dib Oglesby
Replied On July 31, 2015 06:13 PM UTC

To add on to this thread:

I am getting this error as well.  I can created a tab page (Visual Basic), added a PDFViewer control, and loaded up a PDF file.  If I then 1. Click the + button to zoom, 2) Click the down arrow in the bottom right to scroll, and then 3) remove the tab, which includes code to a) close the PDF file, b) call .Dispose on the PDFViewer, and c) clear out the tab's controls, I then get the error when the main screen attempts to redraw.  Here is some of the exception info:

System.ArgumentNullException: {"Value cannot be null.\r\nParameter name: crossTable"}
Data: System.Collections.ListDictionaryInternal
InnerException: Null
Source: Syncfusion.PDF.Base
Stack Trace:    at Syncfusion.Pdf.Parsing.PdfLoadedPageCollection..ctor(PdfDocumentBase document, PdfCrossTable crossTable)
   at Syncfusion.Pdf.Parsing.PdfLoadedDocument.get_Pages()
   at Syncfusion.Windows.Forms.PdfViewer.PdfDocumentView.UpdateByScroll()
   at Syncfusion.Windows.Forms.PdfViewer.PdfDocumentView.timer_Tick(Object sender, EventArgs e)
   at System.EventHandler.Invoke(Object sender, EventArgs e)
   at System.Windows.Forms.Timer.TimerNativeWindow.WndProc(Message& m)
   at System.Windows.Forms.NativeWindow.DebuggableCallback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)
   at System.Windows.Forms.UnsafeNativeMethods.DispatchMessageW(MSG& msg)
   at System.Windows.Forms.Application.ComponentManager.System.Windows.Forms.UnsafeNativeMethods.IMsoComponentManager.FPushMessageLoop(IntPtr dwComponentID, Int32 reason, Int32 pvLoopData)
   at System.Windows.Forms.Application.ThreadContext.RunMessageLoopInner(Int32 reason, ApplicationContext context)
   at System.Windows.Forms.Application.ThreadContext.RunMessageLoop(Int32 reason, ApplicationContext context)
   at Microsoft.VisualBasic.ApplicationServices.WindowsFormsApplicationBase.OnRun()
   at Microsoft.VisualBasic.ApplicationServices.WindowsFormsApplicationBase.DoApplicationModel()
   at Microsoft.VisualBasic.ApplicationServices.WindowsFormsApplicationBase.Run(String[] commandLine)
   at Hurrevac2010.My.MyApplication.Main(String[] Args) in 17d14f5c-a337-4978-8281-53493378c1071.vb:line 81
   at System.AppDomain._nExecuteAssembly(RuntimeAssembly assembly, String[] args)
   at System.Runtime.Hosting.ApplicationActivator.CreateInstance(ActivationContext activationContext, String[] activationCustomData)
   at Microsoft.VisualStudio.HostingProcess.HostProc.RunUsersAssemblyDebugInZone()
   at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
   at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
   at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
   at System.Threading.ThreadHelper.ThreadStart()

Hope this helps.  If there is an update that fixes this, that would be good to know.


Deepak Gunasekaran [Syncfusion]
Replied On August 3, 2015 11:48 AM UTC

Hi Dib,

After investigating the stack trace provided in your post, we could see that this issue is in PDF Viewer Windows Forms.

We were able to reproduce the problem in Windows forms and have logged defect report regarding this. A support incident to track the status of this defect has been created under your account. Please log on to our support website to check for further updates
https://www.syncfusion.com/account/login?ReturnUrl=%2fsupport%2fdirecttrac%2fincidents

Please let me know if you have any questions.

Regards,
Deepak G

Julia Gonzalez
Replied On December 23, 2016 10:03 PM UTC

Was this resolved? I am experiancing the same issue.

Navaneetha Kannan Sudalai Muthu [Syncfusion]
Replied On December 27, 2016 10:03 AM UTC

Hi Vadim, 
The previously reported issue “System.ArgumentNullException is thrown while disposing the PdfViewer after scrolling” in Windows Forms had been fixed and the fix is included in our latest product version.  
Can you please confirm whether the issue on your side occurs in Windows Forms or WinRT? Also, kindly provide us with a sample illustrating the issue or steps to reproduce the issue so that we can proceed further.  
Best, 
Navaneetha Kannan 


Jonathan Khoo
Replied On July 14, 2017 05:06 AM UTC

hi! just wanted to say i'm experiencing this error with the latest UWP version. i can get it to work if i use await + the async as described above, but that seems to be causing other problems that i'll try and work through, but it seems like this error is still present.update: it only seems to happen when i do pdfViewer.LoadDocument(fileStream) where fileStream is a well, file.OpenAsync stream. if i load the document into a byte array first, create a PdfLoadedDocument with that byte array, and then load the PdfLoadedDocument into the viewer, it works fine. *thumbs up*

Ayswarya Krishna Kumar [Syncfusion]
Replied On July 17, 2017 04:22 PM UTC

Hi Customer,
Thank you for your update.
 
1)     if i load the document into a byte array first, create a PdfLoadedDocument with that byte array, and then load the PdfLoadedDocument into the viewer 
We are glad to know that your requirement “Loading the PDF document stream into byte[] and then load the PdfLoadedDocument into the viewer” has been achieved using PDF viewer control 
2)     i can get it to work if i use await + the async as described above, but that seems to be causing other problems that i'll try and work through, but it seems like this error is still present.update: it only seems to happen when i do pdfViewer.LoadDocument(fileStream) where fileStream is a well, file.OpenAsync stream 
We are not able to reproduce the issue, “Exception is thrown when loading PDF stream to the viewer”. We have attached the sample that we tried to reproduce the issue at our end. Please find the sample from the below link. Kindly modify the attached sample or provide us a new sample with which the issue could be reproduced. It would be more helpful for us to investigate further on your requirement and provide you better solution.

Sample link: http://www.syncfusion.com/downloads/support/forum/116169/ze/PdfViewerDemo168850455.zip
 

Regards,
Ayswarya



CONFIRMATION

This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

Warning Icon You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.Close Icon

;