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

Notification

Icon
Error

Options
Go to last post Go to first unread
indigophoenix  
#1 Posted : Wednesday, October 30, 2019 10:23:04 AM(UTC)
indigophoenix

Rank: Newbie

Groups: Registered
Joined: 8/24/2016(UTC)
Posts: 8

Thanks: 5 times
Hello,

When we try to use the WPF PDF viewer to view certain PDFs, the viewer crashes with the stack trace below. We've attached an example to the post. Any help would be appreciated. This happens with the 4.19 version of the SDK.

Thank you!

Patagames.Pdf.Net.Exceptions.FatalErrorException
HResult=0x80131500
Message=Fatal runtime error.
Source=Patagames.Pdf
StackTrace:
at Patagames.Pdf.Pdfium.FPDF_RenderPageBitmap_Start(IntPtr bitmap, IntPtr page, Int32 start_x, Int32 start_y, Int32 size_x, Int32 size_y, PageRotate rotate, RenderFlags flag, IFSDK_PAUSE pause)
at Patagames.Pdf.Net.PdfPage.StartProgressiveRender(PdfBitmap bitmap, Int32 x, Int32 y, Int32 width, Int32 height, PageRotate rotate, RenderFlags flags, Byte[] userData)
at Patagames.Pdf.Net.Controls.Wpf.PRCollection.ProcessExisting(PdfBitmap bitmap, PdfPage page, Int32Rect pageRect, PageRotate pageRotate, RenderFlags renderFlags)
at Patagames.Pdf.Net.Controls.Wpf.PRCollection.RenderPage(PdfPage page, Int32Rect pageRect, PageRotate pageRotate, RenderFlags renderFlags, Boolean useProgressiveRender)
at Patagames.Pdf.Net.Controls.Wpf.PdfViewer.DrawPage(PdfBitmap bitmap, PdfPage page, Rect actualRect)
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)
at System.Windows.Threading.DispatcherOperation.InvokeImpl()
at System.Windows.Threading.DispatcherOperation.InvokeInSecurityContext(Object state)
at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
at MS.Internal.CulturePreservingExecutionContext.Run(CulturePreservingExecutionContext executionContext, ContextCallback callback, Object state)
at System.Windows.Threading.DispatcherOperation.Invoke()
at System.Windows.Threading.Dispatcher.ProcessQueue()
at System.Windows.Threading.Dispatcher.WndProcHook(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam, Boolean& handled)
at MS.Win32.HwndWrapper.WndProc(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam, Boolean& handled)
at MS.Win32.HwndSubclass.DispatcherCallbackOperation(Object o)
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)
at System.Windows.Threading.Dispatcher.LegacyInvokeImpl(DispatcherPriority priority, TimeSpan timeout, Delegate method, Object args, Int32 numArgs)
at MS.Win32.HwndSubclass.SubclassWndProc(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam)
at MS.Win32.UnsafeNativeMethods.DispatchMessage(MSG& msg)
at System.Windows.Threading.Dispatcher.PushFrameImpl(DispatcherFrame frame)
at System.Windows.Threading.Dispatcher.PushFrame(DispatcherFrame frame)
at System.Windows.Application.RunDispatcher(Object ignore)
at System.Windows.Application.RunInternal(Window window)
at System.Windows.Application.Run(Window window)
at System.Windows.Application.Run()
at JW.Document.Previewer.Example.App.Main()

Inner Exception 1:
AccessViolationException: Attempted to read or write protected memory. This is often an indication that other memory is corrupt.
Form.PDF (30kb) downloaded 2 time(s).

Edited by user Wednesday, October 30, 2019 10:24:53 AM(UTC)  | Reason: Not specified

Paul Rayman  
#2 Posted : Wednesday, October 30, 2019 9:53:13 PM(UTC)
Paul Rayman

Rank: Administration

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

Thanks: 2 times
Was thanked: 103 time(s) in 101 post(s)
Hi,

This issue is not reproduces on my part.
Could you, please, provide an sample app where the issue appears?
indigophoenix  
#3 Posted : Thursday, October 31, 2019 7:54:19 PM(UTC)
indigophoenix

Rank: Newbie

Groups: Registered
Joined: 8/24/2016(UTC)
Posts: 8

Thanks: 5 times
Hi,

Thanks for the response. Here is a sample app. Should just have to restore the nuget packages and put a license key in the viewmodel. I had to remove all the dlls because of the uploader wouldn't allow them. Please let me know if you need anything more.

Thanks for the assistance!

SamplePreviewerApp.zip (27kb) downloaded 1 time(s).

Edited by user Thursday, October 31, 2019 7:56:58 PM(UTC)  | Reason: Not specified

Paul Rayman  
#4 Posted : Friday, November 1, 2019 8:41:19 PM(UTC)
Paul Rayman

Rank: Administration

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

Thanks: 2 times
Was thanked: 103 time(s) in 101 post(s)
Thanks for your bug report.
We will fix this issue as soon as possible.
Currently I can suggest a workaround. Please open the documents as shown below.

Code:

public PdfDocument Document
 {
     get
     {
         var stream = new MemoryStream(Resources.Form);
         return PdfDocument.Load(stream, new PdfForms());
     }
}

Edited by user Friday, November 1, 2019 8:42:40 PM(UTC)  | Reason: Not specified

thanks 1 user thanked Paul Rayman for this useful post.
indigophoenix on 11/4/2019(UTC)
Paul Rayman  
#5 Posted : Saturday, November 2, 2019 4:08:25 AM(UTC)
Paul Rayman

Rank: Administration

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

Thanks: 2 times
Was thanked: 103 time(s) in 101 post(s)
thanks 1 user thanked Paul Rayman for this useful post.
indigophoenix on 11/4/2019(UTC)
indigophoenix  
#6 Posted : Monday, November 4, 2019 3:27:58 PM(UTC)
indigophoenix

Rank: Newbie

Groups: Registered
Joined: 8/24/2016(UTC)
Posts: 8

Thanks: 5 times
The fixed version worked great! Thank you for the quick update!
Users browsing this topic
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.