dsf487787 2018-03-30 01:24 采纳率: 100%
浏览 445

如何在Golang中使用winspool.drv打印双面打印

I needed basic printing functionality to print PDFs at variable page sizes. I was able to get this to work with the following code I just posted here. However, trying to access the printer options to get PDFs to print duplex seems very complicated.

Is there a simple way to get these PDFs to print duplex?

  • 写回答

1条回答 默认 最新

  • duanrebo3559 2019-02-15 14:33
    关注

    Just come across this. I'm not sure what you are doing is possible without something to render the PDF in windows and then print it.

    What you are doing (I think) is sending a PDF directly to a printer that supports printing PDFs directly - not all printers do.

    This means that no commands for printer options are sent with it and it bypasses the windows print drivers, you could try prepending some PJL (Printer Job Language)commands to the beginning of the PDF that you send.

    If you can't get that to work or control what you need, then you'll need to have something render the PDF and print it in conjunction with the printer drivers into a native printer language such as PCL or Postscript. Printing in windows usually involves the graphics device interface (GDI) or WPF working with the installed printer driver for your printer. This route should give you access to all printer driver options for your printer.

    评论

报告相同问题?