I am trying to add printing capability to my Windows app. So far, I have succeeded in (1) painting the image into an HDC; (2) saving it as a BMP file; (3) creating a BITMAPINFOHEADER and pixmap in memory; and (4) creating an HBITMAP object.
How can I send any of these to my laser printer? (I don't want to use any third-party app, but rather do it using API calls).
Any suggestions?
Asked
Active
Viewed 140 times
0

DontPanic
- 2,164
- 5
- 29
- 56
1 Answers
0
It looks like you will need to use the XPS Document API, unless your printer driver accepts bmp files as input (which seems unlikely). Another option is to generate output as a postscript file (many printers accept .ps files as input; at least, they used to. Check your printer's documentation).
If you choose the XPS document path, have a look here for the documentation: https://learn.microsoft.com/en-us/windows/win32/printdocs/documents Apparently, in Windows, you can now just send XPS documents to your print spooler, and it should work. I have not tested this.

Robby the Belgian
- 646
- 4
- 10