我正在打印一个包含以下代码的文档:
LocalPrintServer localPrintServer = new LocalPrintServer();
PrintQueue defaultPrintQueue = LocalPrintServer.GetDefaultPrintQueue();
// Call AddJob
PrintSystemJobInfo myPrintJob = defaultPrintQueue.AddJob();
// Write a Byte buffer to the JobStream and close the stream
Stream myStream = myPrintJob.JobStream;
Byte[] myByteBuffer = UnicodeEncoding.Unicode.GetBytes("This is a test string for the print job stream.");
myStream.Write(myByteBuffer, 0, myByteBuffer.Length);
myStream.Close();我很难尝试将inputBin设置为特定的bin。我已经知道要使用的纸盒是"paper bin 3“,我的打印机的值是261。
我知道可以使用如下所示的printTicket来更改bin:
PrintTicket printTicket = defaultPrintQueue.DefaultPrintTicket;
printTicket.InputBin = InputBin.AutoSelect;问题是枚举(system.printing.inputBin),它只包含标准的最小bin。(值从0到5,不包括bin2、bin3等)
问:-在这种情况下,我如何设置纸箱的值?(261)我知道有一种方法可以做到这一点,但几个小时后,我仍然被困在这个问题上。
有什么帮助吗?(请注意,获取bin名称和相应的值并不是我所需要的,我只需要弄清楚如何在打印作业单中设置该值
请注意,它只适用于4.0项目
谢谢
发布于 2016-06-11 01:37:56
我使用在这里找到的奇怪方法(http://www.wittersworld.com/selecting-the-input-tray-when-printing-xps-documents/),并且它可以工作。
https://stackoverflow.com/questions/37753428
复制相似问题