This is a migrated thread and some comments may be shown as answers.

Unhandled COMException when scrolling through a PDF document

1 Answer 93 Views
PDFViewer
This is a migrated thread and some comments may be shown as answers.
carl corselis
Top achievements
Rank 1
carl corselis asked on 07 May 2012, 08:31 AM
Hello,

We have created a small WPF-application which is used to display PDF-files.  Although the application works fine on some machines, on others we get an unhandled COMException when we scroll through the document's pages. The exception is not always thrown on the same page and the size of the document or the speed of scrolling does not seem to have an influence.

The documents we tried to display are not corrupt and can be viewed perfectly with other PDF-viewers.  The PDF documents are also quite small (+/- 10 pages).

Below you find the call stack of the exception.

Application: PdfViewer.exe

Framework Version: v4.0.30319

Description: The process was terminated due to an unhandled exception.

Exception Info: System.Runtime.InteropServices.COMException

Stack:

   at System.Runtime.InteropServices.Marshal.ThrowExceptionForHRInternal(Int32, IntPtr)

   at System.Runtime.InteropServices.Marshal.ThrowExceptionForHR(Int32, IntPtr)

   at MS.Internal.Text.TextInterface.Native.Util.ConvertHresultToException(Int32)

   at MS.Internal.Text.TextInterface.Factory.CreateFontFace(System.Uri, UInt32, MS.Internal.Text.TextInterface.FontSimulations)

   at System.Windows.Media.GlyphTypeface.Initialize(System.Uri, System.Windows.Media.StyleSimulations)

   at System.Windows.Media.GlyphTypeface..ctor(System.Uri, System.Windows.Media.StyleSimulations)

   at System.Windows.Documents.Glyphs.ParseGlyphRunProperties()

   at System.Windows.Documents.Glyphs.ComputeMeasurementGlyphRunAndOrigin()

   at System.Windows.Documents.Glyphs.MeasureOverride(System.Windows.Size)

   at System.Windows.FrameworkElement.MeasureCore(System.Windows.Size)

   at System.Windows.UIElement.Measure(System.Windows.Size)

   at System.Windows.Controls.Canvas.MeasureOverride(System.Windows.Size)

   at System.Windows.FrameworkElement.MeasureCore(System.Windows.Size)

   at System.Windows.UIElement.Measure(System.Windows.Size)

   at System.Windows.Controls.Canvas.MeasureOverride(System.Windows.Size)

   at System.Windows.FrameworkElement.MeasureCore(System.Windows.Size)

   at System.Windows.UIElement.Measure(System.Windows.Size)

   at System.Windows.Controls.Canvas.MeasureOverride(System.Windows.Size)

   at System.Windows.FrameworkElement.MeasureCore(System.Windows.Size)

   at System.Windows.UIElement.Measure(System.Windows.Size)

   at System.Windows.Controls.Canvas.MeasureOverride(System.Windows.Size)

   at System.Windows.FrameworkElement.MeasureCore(System.Windows.Size)

   at System.Windows.UIElement.Measure(System.Windows.Size)

   at System.Windows.ContextLayoutManager.UpdateLayout()

   at System.Windows.ContextLayoutManager.UpdateLayoutCallback(System.Object)

   at System.Windows.Media.MediaContext+InvokeOnRenderCallback.DoWork()

   at System.Windows.Media.MediaContext.FireInvokeOnRenderCallbacks()

   at System.Windows.Media.MediaContext.RenderMessageHandlerCore(System.Object)

   at System.Windows.Media.MediaContext.RenderMessageHandler(System.Object)

   at System.Windows.Threading.ExceptionWrapper.InternalRealCall(System.Delegate, System.Object, Int32)

   at MS.Internal.Threading.ExceptionFilterHelper.TryCatchWhen(System.Object, System.Delegate, System.Object, Int32, System.Delegate)

   at System.Windows.Threading.DispatcherOperation.InvokeImpl()

   at System.Windows.Threading.DispatcherOperation.InvokeInSecurityContext(System.Object)

   at System.Threading.ExecutionContext.runTryCode(System.Object)

   at System.Runtime.CompilerServices.RuntimeHelpers.ExecuteCodeWithGuaranteedCleanup(TryCode, CleanupCode, System.Object)

   at System.Threading.ExecutionContext.RunInternal(System.Threading.ExecutionContext, System.Threading.ContextCallback, System.Object)

   at System.Threading.ExecutionContext.Run(System.Threading.ExecutionContext, System.Threading.ContextCallback, System.Object, Boolean)

   at System.Threading.ExecutionContext.Run(System.Threading.ExecutionContext, System.Threading.ContextCallback, System.Object)

   at System.Windows.Threading.DispatcherOperation.Invoke()

   at System.Windows.Threading.Dispatcher.ProcessQueue()

   at System.Windows.Threading.Dispatcher.WndProcHook(IntPtr, Int32, IntPtr, IntPtr, Boolean ByRef)

   at MS.Win32.HwndWrapper.WndProc(IntPtr, Int32, IntPtr, IntPtr, Boolean ByRef)

   at MS.Win32.HwndSubclass.DispatcherCallbackOperation(System.Object)

   at System.Windows.Threading.ExceptionWrapper.InternalRealCall(System.Delegate, System.Object, Int32)

   at MS.Internal.Threading.ExceptionFilterHelper.TryCatchWhen(System.Object, System.Delegate, System.Object, Int32, System.Delegate)

   at System.Windows.Threading.Dispatcher.InvokeImpl(System.Windows.Threading.DispatcherPriority, System.TimeSpan, System.Delegate, System.Object, Int32)

   at MS.Win32.HwndSubclass.SubclassWndProc(IntPtr, Int32, IntPtr, IntPtr)

   at MS.Win32.UnsafeNativeMethods.DispatchMessage(System.Windows.Interop.MSG ByRef)

   at System.Windows.Threading.Dispatcher.PushFrameImpl(System.Windows.Threading.DispatcherFrame)

   at System.Windows.Threading.Dispatcher.PushFrame(System.Windows.Threading.DispatcherFrame)

   at System.Windows.Threading.Dispatcher.Run()

   at System.Windows.Application.RunDispatcher(System.Object)

   at System.Windows.Application.RunInternal(System.Windows.Window)

   at System.Windows.Application.Run(System.Windows.Window)

   at PdfViewer.App.Main()


We've also tried the Telerik demo application and this also shows an exception that not enough storage is available.  There's definetely enough memory and disk space available for the application. 

Could you please help us solve this issue.

Kind regards.

1 Answer, 1 is accepted

Sort by
0
Vasil
Telerik team
answered on 10 May 2012, 09:05 AM
Hello Carl,

Could you specify which version of the controls you are using and the machine environments where the exception was thrown: operating system, .NET framework, etc. as we were not able to reproduce this failure. Another thing worth checking is the fonts of the machines, as looking through the call stack it seems that the application is trying to initialize some font (at MS.Internal.Text.TextInterface.Factory.CreateFontFace(System.Uri, UInt32, MS.Internal.Text.TextInterface.FontSimulations)). 
We would also appreciate if you send us (through a support ticket) sample project and PDF document that reproduce the exception so we can investigate it further.
The issue with QSF demo application is something we haven't observed before. You could try to start the application directly from the solution, where you can set the Examples\PdfViewer.WPF as startup project.

Looking forward to your reply.

Regards,
Vasil
the Telerik team

Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get it now >>

Tags
PDFViewer
Asked by
carl corselis
Top achievements
Rank 1
Answers by
Vasil
Telerik team
Share this question
or