I am porting a C# program to Linux (using Mono). The only compatibility issues that MoMA has found were all related to printing: P/Invokes of functions from winspool.drv:
- ClosePrinter
- EndDocPrinter
- EndPagePrinter
- OpenPrinter
- StartDocPrinter
- StartPagePrinter
- WritePrinter
These are all used in the same class, which prints files (which must be either PDF or PS) by wrapping them in PJL (to set the paper size/tray/orientation) and calling WritePrinter.
I’ll need to rewrite this printing logic with non-Windows-specific code. A previous question refers to System.Drawing.Printing, but it seems to be way too low level. I don’t want DrawString and DrawImage, I want “print this PostScript file”. Is there functionality in Mono to do this?
I ended up using
System.Diagnostics.Processto call thelpcommand.