[cups] Query regarding setting up common Interface for print jobs

Narcis Garcia informatica at actiu.net
Fri Aug 11 00:53:53 PDT 2017


El 10/08/17 a les 19:59, Brian Potkin ha escrit:
> On Wed 09 Aug 2017 at 09:38:27 +0200, Narcis Garcia wrote:
> 
>> El 08/08/17 a les 20:27, Brian Potkin ha escrit:
>>> On Mon 07 Aug 2017 at 20:59:24 +0200, Narcis Garcia wrote:
>>>
>>>> I suppose this can be made with a filter, writing a simple script that
>>>> gets the job and sends (lp) to one printer depending on job username or
>>>> caption.
>>>
>>> The OP wants to discriminate between submitted files based on which
>>> *application* they came from. In the most general case this is most
>>> likely not doable. Narrowing it down to particular applications might
>>> produce a solution.
>>>
>>
>> Job caption might be set differently by application.
>> This is the data I get with a filter script; hope some field is useful
>> for your OP purpose:
>>
>> JobID="$1"	# Example: "773"
>> JobUsername="$2"	# Example: "user"
>> JobCaption="$3"	# Example: "My cooking recipes"
> 
> [A big snip]
> 
> My problem in understanding JobCaption as a solution is in the context
> of using Debian.
> 
> Evince and Firefox both send a PDF to the printing system. Both PDFs are
> generated by Cairo. How does one distinguish between the applications
> which are used to send "My cooking recipes"?
> 

You need some control over the job cation.
If you cannot set different default queue per printer, then you need the
application to print with distinctive captions.

An additional option for me sometimes has been to read file content or
metadata to deduce which one of known applications has sent the job.
(try pdfinfo and pdftotext from poppler-utils)

Som time, a last option for me has been to read job with OCR when it's
difficult to read file content. E.g.: Firefox jobs begin pages with an
URL in the first line, and date-time at the bottom.
(try tesseract from tesseract-ocr)


More information about the cups mailing list