2

I am using MonoMac (with gtk#) and I need to send raw ZPL commands to CUPS printer. Raw commands look like text. They are not "images". I see that Mono can print images via System.Drawing, but how can I send raw data (raw text) ?

It looks like I need to call PMPrinterPrintWithFile or talk to CUPS API directly. But I don't see bindings for these functions in the Mono.

I know I can do CreateProcess on "lpr" command. It works, but this is a very-very last resort solution.

Alex Uslontsev
  • 543
  • 8
  • 19
  • Have you seen the following [StackOverflow Question](http://stackoverflow.com/questions/2044676/net-code-to-send-zpl-to-zebra-printers) ? The socket approaches listed there should work. Also this question is a possible duplicate of [Printig raw data EPL using Mono C#](http://stackoverflow.com/questions/9114451/printig-raw-data-epl-using-mono-c-sharp). – Appleman1234 Mar 25 '14 at 09:11
  • Socket approach would work for network-attached printers only. I need to print to both local and remote printers. I see no issues with creating a dupe to unanswered question (especially with a bounty) – Alex Uslontsev Mar 25 '14 at 18:38
  • For me, the easiest thing to do was to dump the file to /tmp, then just shell out to command line, passing in the printer name and tmp file as variables. You will want the job to clean up after itself, but make sure that the job is done printing before doing that. – The Dude Dec 21 '18 at 20:21

0 Answers0