'UInt32 System.Printing.PrintQueue.GetDpiX(System.Printing.ILegacyDevice)问题解决方法

Posted bamboo_lady

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了'UInt32 System.Printing.PrintQueue.GetDpiX(System.Printing.ILegacyDevice)问题解决方法相关的知识,希望对你有一定的参考价值。

Since the install of update KB 313xxxx we can no longer print from a WPF application. The following exception occures when System.Windows.Controls.PrintDialog.PrintDocument is called.

Source: ReachFramework
Message:  Source: Method not found: ‘UInt32 System.Printing.PrintQueue.GetDpiX(System.Printing.ILegacyDevice)‘.
Stack Tace:    at Microsoft.Internal.AlphaFlattener.Flattener.Convert(Primitive tree, ILegacyDevice dc, Double width, Double height, Double dpix, Double dpiy, Nullable`1 quality)
   at Microsoft.Internal.AlphaFlattener.MetroDevice0.FlushPage(ILegacyDevice sink, Double width, Double height, Nullable`1 outputQuality)
   at Microsoft.Internal.AlphaFlattener.MetroToGdiConverter.FlushPage()
   at System.Windows.Xps.Serialization.NgcSerializationManager.EndPage()
   at System.Windows.Xps.Serialization.NgcFixedPageSerializer.SerializeObject(Object serializedObject)
   at System.Windows.Xps.Serialization.NgcDocumentPageSerializer.SerializeObject(Object serializedObject)
   at System.Windows.Xps.Serialization.NgcDocumentPaginatorSerializer.SerializeObject(Object serializedObject)
   at System.Windows.Xps.Serialization.NgcSerializationManager.SaveAsXaml(Object serializedObject)
   at System.Windows.Xps.XpsDocumentWriter.SaveAsXaml(Object serializedObject, Boolean isSync)
   at System.Windows.Xps.XpsDocumentWriter.Write(DocumentPaginator documentPaginator, PrintTicket printTicket)
   at System.Windows.Controls.PrintDialog.PrintDocument(DocumentPaginator documentPaginator, String description)

Uninstalling the update resolves the issue.

Issue occurs on Windows 7, .NET 3.5/4, x86 with physical printers and not virtual ones such as Sent To OneNote or XPS. Occures on both Xerox 7380 and Intermec PF4I.

以上是关于'UInt32 System.Printing.PrintQueue.GetDpiX(System.Printing.ILegacyDevice)问题解决方法的主要内容,如果未能解决你的问题,请参考以下文章

GLib-CRITICAL : g_variant_get_uint32: assertion ‘g_variant_is_of_type (value, G_VARIANT_TYPE_UINT32)

uint32_t 和 size_t 的 printf 格式说明符

Python ctypes 中的指针和数组

从 uint8_t* 到 uint32_t 的无效转换 - 从 32 位架构迁移到 64 位架构时?

从uint32_t [16]数组到uint32_t变量序列的64位副本

当尝试`uint mask = ~0;`时,常量值'-1'不能转换为'uint'