PrintPreview and Custom page size

SyntaxEditor for Windows Forms Forum

Posted 17 years ago by Nik Verkhovtseff
Version: 4.0.0238
Platform: .NET 2.0
Environment: Windows XP (32-bit)
Avatar
Hi,

I got an exception in TestApplication (SDI Editor) when I set paper size to Custom in Page Setup dialog, and then select Print Preview:

See the end of this message for details on invoking
just-in-time (JIT) debugging instead of this dialog box.

************** Exception Text **************
System.Runtime.InteropServices.ExternalException: A generic error occurred in GDI+.
at System.Drawing.Imaging.Metafile..ctor(IntPtr referenceHdc, Rectangle frameRect, MetafileFrameUnit frameUnit, EmfType type, String desc)
at System.Drawing.Imaging.Metafile..ctor(IntPtr referenceHdc, Rectangle frameRect, MetafileFrameUnit frameUnit, EmfType type)
at System.Drawing.Printing.PreviewPrintController.OnStartPage(PrintDocument document, PrintPageEventArgs e)
at System.Windows.Forms.PrintControllerWithStatusDialog.OnStartPage(PrintDocument document, PrintPageEventArgs e)
at System.Drawing.Printing.PrintController.PrintLoop(PrintDocument document)
at System.Drawing.Printing.PrintController.Print(PrintDocument document)
at System.Drawing.Printing.PrintDocument.Print()
at System.Windows.Forms.PrintPreviewControl.ComputePreview()
at System.Windows.Forms.PrintPreviewControl.CalculatePageInfo()
at System.Windows.Forms.Control.InvokeMarshaledCallbackDo(ThreadMethodEntry tme)
at System.Windows.Forms.Control.InvokeMarshaledCallbackHelper(Object obj)
at System.Threading.ExecutionContext.runTryCode(Object userData)
at System.Runtime.CompilerServices.RuntimeHelpers.ExecuteCodeWithGuaranteedCleanup(TryCode code, CleanupCode backoutCode, Object userData)
at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state)
at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
at System.Windows.Forms.Control.InvokeMarshaledCallback(ThreadMethodEntry tme)
at System.Windows.Forms.Control.InvokeMarshaledCallbacks()



Thanks,
Nik

Comments (2)

Posted 17 years ago by Actipro Software Support - Cleveland, OH, USA
Avatar
Hi Nik,

It working ok for me here. But since the stack trace doesn't include our assemblies at all, I'm inclined to think this is a Microsoft bug, not ours. Perhaps try Googling it.


Actipro Software Support

Posted 17 years ago by Nik Verkhovtseff
Avatar
Hi,

When I look at page settings in debugger, I see that page size is "empty" (width and height are 0). I suppose this is due to "virtual" printer - Microsoft Office Document Image Writer.

Thanks,
Nik
The latest build of this product (v24.1.0) was released 2 months ago, which was after the last post in this thread.

Add Comment

Please log in to a validated account to post comments.