Rank: Member
Groups: Registered
Joined: 3/10/2017(UTC) Posts: 12
Thanks: 1 times
|
Hi,
I am using the PdfViewer in a custom control that allows users to resize the pdfViewer with a GridSplitter. I am finding that when a user resizes too much too quickly, the memory usage skyrockets and I end up getting a OutOfMemoryException:
System.OutOfMemoryException: Insufficient memory to continue the execution of the program. at System.Windows.Media.Imaging.WriteableBitmap..ctor(Int32 pixelWidth, Int32 pixelHeight, Double dpiX, Double dpiY, PixelFormat pixelFormat, BitmapPalette palette) at Patagames.Pdf.Net.Controls.Wpf.PdfViewer.DrawCanvasToContext(DrawingContext drawingContext, Int32 cw, Int32 ch, Boolean allPagesAreRendered) at Patagames.Pdf.Net.Controls.Wpf.PdfViewer.OnRender(DrawingContext drawingContext) at System.Windows.UIElement.Arrange(Rect finalRect) at System.Windows.ContextLayoutManager.UpdateLayout() at System.Windows.ContextLayoutManager.UpdateLayoutCallback(Object arg) at System.Windows.Media.MediaContext.InvokeOnRenderCallback.DoWork() at System.Windows.Media.MediaContext.FireInvokeOnRenderCallbacks() at System.Windows.Media.MediaContext.RenderMessageHandlerCore(Object resizedCompositionTarget) at System.Windows.Media.MediaContext.RenderMessageHandler(Object resizedCompositionTarget) at System.Windows.Threading.ExceptionWrapper.InternalRealCall(Delegate callback, Object args, Int32 numArgs) at System.Windows.Threading.ExceptionWrapper.TryCatchWhen(Object source, Delegate callback, Object args, Int32 numArgs, Delegate catchHandler)
Is this simply a limitation of the PdfViewer? Or is there something I can do on my end to limit the amount of memory used when the PdfViewer resizes? I am using version 3.2.3.0 of the Pdfium.NET SDK.
|
|
|
|
|
|
Rank: Administration
Groups: Administrators
Joined: 1/5/2016(UTC) Posts: 1,138
Thanks: 10 times Was thanked: 133 time(s) in 130 post(s)
|
|
 1 user thanked Paul Rayman for this useful post.
|
|
|
|
Rank: Member
Groups: Registered
Joined: 3/10/2017(UTC) Posts: 12
Thanks: 1 times
|
Hi Paul,
Thank you for the direction. So I downloaded the the latest version, yet I am still getting the out of memory exception if I resize too rapidly.
I did notice I needed to use the x32 pdfium.dll instead of the x64 one. The x64 one couldn't be found when Initialize was called but the x32 one could. I would guess because of the license key? But I'm not sure if this would have any effect seeing as the error seems directly related to the PdfViewer.
I also noticed that the Patagames.Pdf.Wpf.dll was version 3.5.5.0, not 3.7.4.2704 as the rest of the libraries which also surprised me a little.
|
|
|
|
|
|
Rank: Administration
Groups: Administrators
Joined: 1/5/2016(UTC) Posts: 1,138
Thanks: 10 times Was thanked: 133 time(s) in 130 post(s)
|
we will try to fix it in the next release. Thanks.
|
|
|
|
|
|
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