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

Notification

Icon
Error

Options
Go to last post Go to first unread
shivan.singh@lexisnexis.co.za  
#1 Posted : Monday, January 29, 2018 5:07:43 AM(UTC)
shivan.singh@lexisnexis.co.za

Rank: Member

Groups: Registered
Joined: 1/26/2018(UTC)
Posts: 11

Thanks: 1 times
Hi there

I am trying out Pdfium.Net before I buy a license.
I am using the WPF control.

Viewing very small PDF files (under 500 KB) is fine.
However I tried an 800 KB PDF file containing 27 pages, and a 15 MB PDF file containing 90 pages.
The following exception is thrown:
System.StackOverflowException was unhandled
Message: An unhandled exception of type 'System.StackOverflowException' occurred in Patagames.Pdf.Wpf.dll

Note that all the PDF files I have been testing only contain text, no images.

I am using the 32 bit control, as other libraries in my app are 32 bit as well.
Therefore I cannot try the 64 bit control as this breaks my app.

The code I am using is inside the constructor of the XAML:
InitializeComponent();
//Gets the location of the current assembly as URI
string codeBase = System.Reflection.Assembly.GetExecutingAssembly().CodeBase;
UriBuilder uri = new UriBuilder(codeBase);
string assemblyPath = Uri.UnescapeDataString(uri.Path);
//Gets directory for assembly
var base_path = System.IO.Path.GetDirectoryName(assemblyPath);
//Combine path to Pdfium.dll
var path = System.IO.Path.Combine(base_path, @"x86\pdfium.dll");
//Initialize library
PdfCommon.Initialize(null, path);
pdfViewer.LoadDocument(@"c:\test.pdf");

I tried adding the following code before calling pdfViewer.LoadDocument:
PdfCommon.IsCheckForMemoryLeaks = true;
pdfViewer.OptimizedLoadThreshold = 1;
pdfViewer.PageAutoDispose = true;
pdfViewer.TilesCount = 1;
pdfViewer.UseProgressiveRender = true;
pdfViewer.UseLayoutRounding = true;
pdfViewer.ViewMode = Patagames.Pdf.Net.Controls.Wpf.ViewModes.SinglePage;

The PDF Viewer now shows the first page of the document.
If I try to go to the next page, the same exception is thrown.

Pdfium.dll version 3.17.2.2704
Patagames.Pdf, version 3.16.2.45
Patagames.Pdf.WinForms, version 3.14.3.45
Patagames.Pdf.Wpf, version 3.14.3.45

Please assist.
Thank you.

Edited by user Monday, January 29, 2018 5:13:28 AM(UTC)  | Reason: Not specified

Paul Rayman  
#2 Posted : Monday, January 29, 2018 5:12:33 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)
Hi,

Could you please provide stack trace?
And PDF document too
Are you use latest version? Also let me know please how you install it (MSI, ZIP or NuGet)

Edited by user Monday, January 29, 2018 5:29:26 AM(UTC)  | Reason: Not specified

shivan.singh@lexisnexis.co.za  
#3 Posted : Monday, January 29, 2018 5:29:41 AM(UTC)
shivan.singh@lexisnexis.co.za

Rank: Member

Groups: Registered
Joined: 1/26/2018(UTC)
Posts: 11

Thanks: 1 times
Originally Posted by: Paul Rayman Go to Quoted Post
Hi,

Could you please provide stack trace?
And PDF document too

Webbers Updated UAT Test Pack 10 November 2017.pdf (884kb) downloaded 17 time(s). Webbers Updated UAT Test Pack 10 November 2017.pdf (884kb) downloaded 17 time(s).
Unfortunately there is no stack trace available, I can only see the "View Disassembly" option.
When the exception occurs, I get a "No Symbols Loaded" tab inside Visual Studio.
There is a message about a missing Patagames.Pdf.pdb file.

I tried wrapping pdfViewer.LoadDocument in a Try...Catch block and setting a breakpoint on Catch, however that breakpoint is never hit Webbers Updated UAT Test Pack 10 November 2017.pdf (884kb) downloaded 17 time(s). Webbers Updated UAT Test Pack 10 November 2017.pdf (884kb) downloaded 17 time(s). Webbers Updated UAT Test Pack 10 November 2017.pdf (884kb) downloaded 17 time(s)..

The PDF file is attached.

Thank you.
shivan.singh@lexisnexis.co.za  
#4 Posted : Monday, January 29, 2018 5:31:31 AM(UTC)
shivan.singh@lexisnexis.co.za

Rank: Member

Groups: Registered
Joined: 1/26/2018(UTC)
Posts: 11

Thanks: 1 times
Originally Posted by: Paul Rayman Go to Quoted Post
Hi,

Could you please provide stack trace?
And PDF document too
Are you use latest version? Also let me know please how you install it (MSI, ZIP or NuGet)


It is the latest version installed via NuGet.

Pdfium.dll, version 3.17.2.2704
Patagames.Pdf, version 3.16.2.45
Patagames.Pdf.WinForms, version 3.14.3.45
Patagames.Pdf.Wpf, version 3.14.3.45
Paul Rayman  
#5 Posted : Monday, January 29, 2018 5:39:13 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)
That's OK.
The issue is reproduced on your file, so I can check it now.
shivan.singh@lexisnexis.co.za  
#6 Posted : Monday, January 29, 2018 5:57:54 AM(UTC)
shivan.singh@lexisnexis.co.za

Rank: Member

Groups: Registered
Joined: 1/26/2018(UTC)
Posts: 11

Thanks: 1 times
Originally Posted by: Paul Rayman Go to Quoted Post
That's OK.
The issue is reproduced on your file, so I can check it now.


Thank you, awaiting your feedback
Paul Rayman  
#7 Posted : Monday, January 29, 2018 7:02:01 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)
Many thanks for bug report.

Please find a hotfix here:
https://forum.patagames....released-on-Jan-30--2018

PS. It may takes some time while NuGet package will be indexed.
thanks 1 user thanked Paul Rayman for this useful post.
shivan.singh@lexisnexis.co.za on 1/30/2018(UTC)
shivan.singh@lexisnexis.co.za  
#8 Posted : Tuesday, January 30, 2018 4:49:32 AM(UTC)
shivan.singh@lexisnexis.co.za

Rank: Member

Groups: Registered
Joined: 1/26/2018(UTC)
Posts: 11

Thanks: 1 times
Originally Posted by: Paul Rayman Go to Quoted Post
Many thanks for bug report.

Please find a hotfix here:
https://forum.patagames....released-on-Jan-30--2018

PS. It may takes some time while NuGet package will be indexed.


I have tested the new release and can confirm that the issue is resolved.
Many thanks for the quick resolution!
Users browsing this topic
Guest (3)
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.