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