CUPS Fax Backend Howto?

Tilman Schmidt tilman at imap.cc
Wed Jul 6 16:28:33 PDT 2011


On 2011-07-03 07:27, Helge Blischke wrote:
> Tilman Schmidt wrote:
>
> > [trying to create] a capifax CUPS backend connecting capifax
> > directly into CUPS, like fax4CUPS does for some other fax programs.
> > I would be grateful for comments on how to address these problems:
> >
> > 1. When printing from the command line through the "lp" command,
> > specifying the destination number works fine, either as the job name or as
> > option "phone". This does not work when printing from an application. The
> > "pseudo-Foomatic driver" section at the end of the PPD file doesn't seem
> > to have any effect.
> >
> > 2. Printing from the command line only works for PostScript files. Other
> > formats seem to get sent to the backend without conversion, making
> > GhostScript barf. I expected CUPS to take care of that, converting
> > everything to PostScript before passing it to my backend.
> >
> > 3. The three parameters $MSN (own MSN to use for sending), $HEADER (fax
> > sender name) and $IDENT (fax sender ID) are configured in the backend
> > itself. It would be more natural to be able to set them in the printer
> > configuration dialog, but I couldn't find a way to define free text
> > parameters there.

> First, the "pseudo-Foomatic driver" stuff in the PPD is obsolete.

Ok. What's the replacement? How do I ask the user submitting a print job for required additional information such as a destination fax number?

> Second, I'd suggest to do all the necessary conversions in a filter, say
> pstocapifax, and specify this filter in the PPD as follows:
> *cupsFilter: "application/vnd.cups-postscript 0 pstocapifax"
> This guarantees that any input format gets correctly transformed to the faxg3 tiff
> format.

I tried that but it didn't work. With the above line in the PPD, when I print a PDF file, CUPS runs the filter "pstops", as witnessed by the CUPS error_log:

I [07/Jul/2011:00:13:06 +0200] [Job ???] Request file type is application/postsc
ript.
I [07/Jul/2011:00:13:06 +0200] [Job 224] Adding start banner page "none".
I [07/Jul/2011:00:13:06 +0200] [Job 224] Adding end banner page "none".
I [07/Jul/2011:00:13:06 +0200] [Job 224] File of type application/postscript que
ued by "ts".
I [07/Jul/2011:00:13:06 +0200] [Job 224] Queued on "capifax" by "ts".
I [07/Jul/2011:00:13:06 +0200] [Job 224] Started filter /usr/lib64/cups/filter/p
stops (PID 484)
I [07/Jul/2011:00:13:06 +0200] [Job 224] Started backend /usr/lib64/cups/backend
/capifax (PID 485)
E [07/Jul/2011:00:13:30 +0200] [Job 224] Fax transmission failed with code 41
E [07/Jul/2011:00:13:30 +0200] PID 485 (/usr/lib64/cups/backend/capifax) stopped with status 1!
I [07/Jul/2011:00:13:30 +0200] Hint: Try setting the LogLevel to "debug" to find out more.
I [07/Jul/2011:00:13:30 +0200] [Job 224] Backend returned status 1 (failed)

And capifax rightly complains:

/var/spool/cups/tmp/capifaxPLYTgV: Not a TIFF or MDI file, bad magic number 8485
 (0x2125).

The "bad magic number" is of course the PostScript starting sequence "!%".

> Third, I'd append the printer specific options to the device-uri
> (separated by the proper uri by a "?")

How would I do that? Specifically, how can I modify the device-uri of a print queue dynamically to append user-specified configuration options?

> and implement means to extract the destination number e.g. from the job title
> or whatever you like.

What I'd like is to obtain it interactively from the user. The use case for fax support in CUPS is this: a user wanting to fax a document chooses "print" from some application and select the fax device in the print dialog. At that moment the information on where to send it only exists in the user's head. She needs a way to give it to the computer, either in the print dialog itself or in an auxiliary dialog popping up after she has clicked "print".

Thanks,
Tilman





More information about the cups mailing list