logo
Welcome Guest! To enable all features please Login or Register.

Notification

Icon
Error

Options
Go to last post Go to first unread
Fabioal  
#1 Posted : Wednesday, June 28, 2017 12:32:12 PM(UTC)
Fabioal

Rank: Newbie

Groups: Registered
Joined: 6/28/2017(UTC)
Posts: 6
Brazil

Using the Patagames.Pdf after preview some files we're receiving the error below:

System.AccessViolationException occurred
HResult=-2147467261
Message=Attempted to read or write protected memory. This is often an indication that other memory is corrupt.
Source=Patagames.Pdf
StackTrace:
at Patagames.Pdf.Pdfium.FPDF_GetPageSizeByIndex_native(IntPtr document, Int32 page_index, Double& width, Double& height)
at Patagames.Pdf.Pdfium.FPDF_GetPageSizeByIndex(IntPtr document, Int32 page_index, Double& width, Double& height)
at Patagames.Pdf.Net.Controls.Wpf.PdfViewer.GetRenderSize(Int32 index)
InnerException:


Code:

PatagamesAccessViolation.png (112kb) downloaded 42 time(s).

Thank you for your support
Paul Rayman  
#2 Posted : Wednesday, June 28, 2017 4:26:40 PM(UTC)
Paul Rayman

Rank: Administration

Groups: Administrators
Joined: 1/5/2016(UTC)
Posts: 1,138

Thanks: 10 times
Was thanked: 133 time(s) in 130 post(s)
Are you using latest version of the PdfViewer?
Fabioal  
#3 Posted : Thursday, June 29, 2017 4:22:35 AM(UTC)
Fabioal

Rank: Newbie

Groups: Registered
Joined: 6/28/2017(UTC)
Posts: 6
Brazil

Yes, we're using these versions:

Patagames.Pdf.dll - 3.7.7.2704

Patagames.Pdf.Wpf.dll - 3.5.7.0

Pdfium - 3.7.2.2704

Thank you
Paul Rayman  
#4 Posted : Thursday, June 29, 2017 5:37:40 AM(UTC)
Paul Rayman

Rank: Administration

Groups: Administrators
Joined: 1/5/2016(UTC)
Posts: 1,138

Thanks: 10 times
Was thanked: 133 time(s) in 130 post(s)
As I can see you are using PdfViewer builded from source code. Do you made any changes in that code?
Could you please provide more info about steps to reproduce this issue and about environment.
Also, if it is possible, please create a minimal app where this issue may be reproduced and email that app to support@patagames.com

Thanks.
Fabioal  
#5 Posted : Thursday, June 29, 2017 7:31:11 AM(UTC)
Fabioal

Rank: Newbie

Groups: Registered
Joined: 6/28/2017(UTC)
Posts: 6
Brazil

Hi Paul,

Yes, we're using the PdfViewer without changes for debug purposes.

By now we don't have a minimal app to send. However, the scenario we have is this:

  1. We get a modified byte array from the Aspose (with highlighted text) and give to Pdfium.
  2. It works good most of the time.
  3. Switching between a list of documents then the error appears. However, is randomic.


Thank you.
Paul Rayman  
#6 Posted : Thursday, June 29, 2017 8:01:39 AM(UTC)
Paul Rayman

Rank: Administration

Groups: Administrators
Joined: 1/5/2016(UTC)
Posts: 1,138

Thanks: 10 times
Was thanked: 133 time(s) in 130 post(s)
Please try to change byte array to stream.
I'm guessing the problem in the byte array.
Pdfium has some bugs in byte array processing. Currently we are working on patch that will fix them.
Fabioal  
#7 Posted : Thursday, June 29, 2017 11:44:24 AM(UTC)
Fabioal

Rank: Newbie

Groups: Registered
Joined: 6/28/2017(UTC)
Posts: 6
Brazil

We're doing test with a version using the MemoryStream.

One question regarding the dispose:

Is the MemoryStream being disposed by pdfium on its own or do we still need to dispose of it manually?
Paul Rayman  
#8 Posted : Thursday, June 29, 2017 3:30:22 PM(UTC)
Paul Rayman

Rank: Administration

Groups: Administrators
Joined: 1/5/2016(UTC)
Posts: 1,138

Thanks: 10 times
Was thanked: 133 time(s) in 130 post(s)
Currently you must close it yourself.
I hope AutoClose property for the stream will be added in the future release.
Fabioal  
#9 Posted : Friday, June 30, 2017 4:51:28 AM(UTC)
Fabioal

Rank: Newbie

Groups: Registered
Joined: 6/28/2017(UTC)
Posts: 6
Brazil

We're passing the MemoryStream wrap at PdfDocument.Load and doing the PdfDocument.Dispose.
Do I need to store a pointer to the MemoryStream and do close/dispose of it even after that? Is that what you mean?
Paul Rayman  
#10 Posted : Tuesday, July 4, 2017 6:03:49 AM(UTC)
Paul Rayman

Rank: Administration

Groups: Administrators
Joined: 1/5/2016(UTC)
Posts: 1,138

Thanks: 10 times
Was thanked: 133 time(s) in 130 post(s)
Fabioal  
#11 Posted : Tuesday, July 4, 2017 6:23:52 AM(UTC)
Fabioal

Rank: Newbie

Groups: Registered
Joined: 6/28/2017(UTC)
Posts: 6
Brazil

Thank you Paul. We're using the MemoryStream version and solved the problem for us until now.

Users browsing this topic
Guest
Forum Jump  
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.