Can I do Windows printing in Go?

481 views
Skip to first unread message

Stillshot

unread,
Apr 3, 2018, 12:56:49 AM4/3/18
to golang-nuts
I don't know if this is the correct place for asking a question like this but as I've asked in several other places, was hoping this would get me somewhere.

I have working for quite a while to try and print PDFs using Go. As the rest of my application is in Go I really want to get this to work without going to another language to solve my problem. Currently, I am able to get the PDFs to print out on the correct size paper for each page of the PDF. This way if there are legal and letter size pages in the same PDF they print correctly. However, I cannot figure out how to set any of the printer settings. Specifically, I need to set the printer to print double sided (duplex). I posted a github report <a href="https://github.com/jadefox10200/goprint">here</a> with where I got. I tried several methods of changing the devmode but when I set it, it doesn't seem to take effect on the printer even though I'm not getting any errors.

ANY advice on this topic would be greatly appreciated. Thanks!

oju...@gmail.com

unread,
Apr 4, 2018, 8:29:16 AM4/4/18
to golang-nuts
Take a look at a Windows utility named printui.EXE . It is meant to be used by scripts to configure printer settings.
Reply all
Reply to author
Forward
0 new messages