PrintCapabilities未为启用的打印机返回Duplex

时间:2016-01-27 17:21:41

标签: wpf vb.net printing

我有一台HP 6500打印机,如果设置正确,将以双面打印。

我正在制作一个自动打印到其他打印机的程序,但我注意到该打印机的PrintCapabilities存在问题 - 它不包含JobDuplexAllDocuments连续 - 双面打印选项。

方法如下。我无法发布结果,因为它们太长了。有谁知道为什么这不能按预期工作?我想确认一台打印机可以在我发送作业之前打印双面打印,但是怎么样?

瑞克

以下是我如何获得PrintCapabilites:

  Dim pq As Printing.PrintQueue = Printing.LocalPrintServer.GetDefaultPrintQueue
            ' get a stored printticket that has Duplex = TwoSidedShortEdge
            Dim ps As RG.Data.Program_Setting = RG.Data.Program_Setting.GetObject(Environment.MachineName)
            Dim cs As RG.Data.Computer_Setting = ps.value_object_cast
            Dim pt As Printing.PrintTicket = cs.print_ticket_document
            'confirm that duplex is set
            MsgBox(pt.Duplexing.ToString)
            Dim ms = pq.GetPrintCapabilitiesAsXml(pt)
            ms.Position = 0
            Using fs = RG.Utilities.GetTempFileStream(".xml")
                fs.Write(ms.ToArray, 0, ms.Length - 1)
                fs.Close()
            End Using

我也试过pq.GetPrintCapabilitiesAsXml()并得到相同的结果:

0 个答案:

没有答案