Rank: Newbie
Groups: Registered
Joined: 6/28/2017(UTC) Posts: 6 
|
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
|
|
|
|
|
|
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?
|
|
|
|
|
|
Rank: Newbie
Groups: Registered
Joined: 6/28/2017(UTC) Posts: 6 
|
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
|
|
|
|
|
|
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.comThanks.
|
|
|
|
|
|
Rank: Newbie
Groups: Registered
Joined: 6/28/2017(UTC) Posts: 6 
|
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:
- We get a modified byte array from the Aspose (with highlighted text) and give to Pdfium.
- It works good most of the time.
- Switching between a list of documents then the error appears. However, is randomic.
Thank you.
|
|
|
|
|
|
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.
|
|
|
|
|
|
Rank: Newbie
Groups: Registered
Joined: 6/28/2017(UTC) Posts: 6 
|
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?
|
|
|
|
|
|
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.
|
|
|
|
|
|
Rank: Newbie
Groups: Registered
Joined: 6/28/2017(UTC) Posts: 6 
|
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?
|
|
|
|
|
|
Rank: Administration
Groups: Administrators
Joined: 1/5/2016(UTC) Posts: 1,138
Thanks: 10 times Was thanked: 133 time(s) in 130 post(s)
|
|
|
|
|
|
|
Rank: Newbie
Groups: Registered
Joined: 6/28/2017(UTC) Posts: 6 
|
Thank you Paul. We're using the MemoryStream version and solved the problem for us until now.
|
|
|
|
|
|
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.
Important Information:
The Patagames Software Support Forum uses cookies. By continuing to browse this site, you are agreeing to our use of cookies.
More Details
Close