apple / cups

Apple CUPS Sources
https://www.cups.org
Apache License 2.0
1.85k stars 452 forks source link

how to create a backend that can be CUPS recognize? #6195

Closed tthnu closed 3 weeks ago

tthnu commented 3 weeks ago

I've created a new backend which is based on the cups-pdf but with fewer code , only keeping the main function and triming the code which is used to generate config file.

After compiling using gcc -O9 -s cups-pdf.c -lcups and copying cups-mybackend binary to /usr/lib/cups/backend/, also copying the ppd file to /usr/share/ppd/cups-mybackend, CUPS cannot recognize this new backend.(sudo lpinfo -v has nothing about cups-my-backend and it also couldn't be selected in AddPrinter in WEB .)

So how should I do to let CUPS know this new backend?

jsmeix commented 3 weeks ago

When you use Linux, you may have a look here: https://en.opensuse.org/SDB:Using_Your_Own_Backends_to_Print_with_CUPS

When you use macOS I don't know. I think in macOS CUPS runs within some kind of "sandbox" so user-made CUPS backends may not be allowed by default? But this is only a blind guess.

Current CUPS upstream is no longer here but under https://github.com/OpenPrinting at https://github.com/OpenPrinting/cups

When you use macOS this place here could be still the right place for CUPS on macOS - I don't know?

tthnu commented 3 weeks ago

When you use Linux, you may have a look here: https://en.opensuse.org/SDB:Using_Your_Own_Backends_to_Print_with_CUPS

When you use macOS I don't know. I think in macOS CUPS runs within some kind of "sandbox" so user-made CUPS backends may not be allowed by default? But this is only a blind guess.

Current CUPS upstream is no longer here but under https://github.com/OpenPrinting at https://github.com/OpenPrinting/cups

When you use macOS this place here could be still the right place for CUPS on macOS - I don't know?

Thanks for your reply!

I've read some manuals you provide and source codes of different backend and found that any new backend MUST report its information through stdout with the form "device_scheme, device_uri, device_make_and_model, device_info, device_id, device_location" or could call cupsBackendReport function instead. CUPS will soon recognize this new backend after reporting operation.