I have a device/appliance that you cannot install drivers for. I would like to add the ability to support network/IPP/AirPrint printers by having the user add the IP Addresses.
Since I am not printing through windows (which would use the IPP), how do I use IPP myself? Is there a c# client (or any windows library) out there that allows you to interact with IPP printers with the IPP protocol?
There are a few IPP client implementations and IPP libraries available for different programming languages (java/php/python). A practical solution could be to use the ipptool
available at https://openprinting.github.io/cups/. Create an ipp-command-file called printjob.ipp
:
{
OPERATION Print-Job
GROUP operation-attributes-tag
ATTR charset attributes-charset utf-8
ATTR language attributes-natural-language en
ATTR uri printer-uri $uri
FILE $filename
}
Now you should be able to print a PDF file using these options:
ipptool -tv -f mydoc.pdf ipp://192.168.2.207 printjob.ipp
Make sure the printer (or print server) supports the document format you send. I assume you're familiar with how to execute an external command in your application.
Even though the ipptool
is provided by CUPS it works perfect with any IPP printer. Check RFC 3510 or your printers documentation for the appropriate printer-uri-scheme or use ippfind
.
Experienced developers should be able to implement the print job operation in their preferred programming language and ecosystem. I have implemented the use case from above in kotlin with 100 lines of code: https://github.com/gmuth/ipp-printjob-kotlin.
This is my minimal PrintJob implementation in Java: https://github.com/gmuth/ipp-printjob-java