FOOMATIC-RIP(1)

πŸ“¦
version 2.0.1 Β· 4 versions
, in alpine 3.24, arch rolling, debian bookworm, debian trixie, nixos 26.05, nixpkgs unstable, opensuse-leap 16.0, ubuntu jammy, ubuntu noble, ubuntu questing, ubuntu resolute, ubuntu stonking

✨ FOOMATIC-RIP πŸ’…

okay bestie, gather round, because this one's a whole thing and it's lowkey iconic. this is the foomatic-rip manual page, from the cups-filters collection β€” and no, it's not filed under "General Commands Manual" at the top anymore, i already folded that in for you 🫢


🌸 NAME 🌸

foomatic-rip β€” the universal print filter / RIP wrapper. that's it, that's the vibe. it's giving "middleware but make it fashion" ✨


πŸŽ€ SYNOPSIS πŸŽ€

πŸ’– General Options:

foomatic-rip [-v] [-q] <mode-specific options>

πŸ¦‹ Spooler-less printing filter:

foomatic-rip [-P <printer>  |  --ppd  <ppdfile> ]  [-J <jobtitle> ] [-o
 <option>=<value>  [...]]  [<files>]

🌈 CUPS filter:

foomatic-rip <jobid> <user> <jobtitle> <numcopies> <options> [<file>]

πŸ‘‘ DESCRIPTION πŸ‘‘

so foomatic-rip is a universal print filter that can either be a CUPS filter or go stand-alone for spooler-less, direct printing. main character energy, honestly. here's what it's serving πŸ’…:

  • It translates PostScript and PDF β€” from standard input or from a file β€” into the printer's native language on standard output. literally the whole glow-up happens right there πŸ”₯
  • The translation is done with an external renderer, usually Ghostscript (gs(1)). And get this: if no translation is needed (say, it's a PostScript printer), the renderer's command line reduces to cat(1). the way it just simplifies β€” we love to see it 😭
  • Printer capabilities, how to handle user options, and how to build the renderer command line β€” all of that is always described by PPD files. these PPD files usually come from Foomatic, or they can be the ones supplied by the manufacturers of PostScript printers. The PPD files are the same for both CUPS and direct printing. one PPD, two modes, no cap 🌟
  • foomatic-rip works with CUPS and for direct printing (without spooler) β€” the latter is mainly for testing and debugging. The mode is selected by the command line options and environment variables which are supplied to foomatic-rip. iykyk 🧚
  • and here's the slay: foomatic-rip doesn't only apply option settings supplied by the user through the command line of the printing command β€” it also searches the entire job for embedded option settings (only PostScript jobs, bestie βœ‹). And not just settings that affect the whole job: settings in the page headers get applied too, and those are only valid for the page where they were found. so applications that produce PostScript code with page-specific printer option settings are fully supported. obsessed. πŸ’–

πŸ¦‹ DIRECT, SPOOLER-LESS PRINTING πŸ¦‹

πŸ’œ Options

  • -v β€” verbose mode for debugging. > WARNING: This will create a file in /tmp that contains the debugging information. This opens a security loophole and should not be used in production. πŸ‘€ like, fr fr, don't ship this.
  • -q β€” quiet mode β€” minimal information output 🀫
  • -P <printer> β€” <printer> is the configured printer which should be used for this job.
  • --ppd <ppdfile> β€” The PPD file <ppdfile> should be applied for processing this job.
  • -o <option>=<value> β€” Option settings for this job.
  • <files> β€” The file(s) to be printed.

okay so foomatic-rip will print from standard input unless at least one file to be printed is specified on the command line. and here's a cute shortcut: if your printer PPD file is stored as /etc/direct/<printer>.ppd or ~/.foomatic/direct/<printer>.ppd you can use it by simply specifying "-P <printer>". no path, no stress πŸ’…


now put a line

*FoomaticRIPPostPipe: "| <command>"

into the PPD file, right after *PPD-Adobe: "4.3", where <command> is a command into which you want to re-direct the output data. but plot twist 😭 due to the restrictions of PPD files <, >, and " are not allowed in the <command>, so replace them as follows:

  • < becomes &lt;
  • > becomes &gt;
  • " becomes &quot;
  • ' becomes &apos;
  • & becomes &amp;

(she made a little table in the original and i'm lovingly bullet-ifying it, but the characters are exact, don't come for me 🫢)


This way you can print directly to your printer β€” use

*FoomaticRIPPostPipe: "| cat &gt; /dev/lp0"

or

*FoomaticRIPPostPipe: "| cat &gt; /dev/usb/lp0"

for local parallel or USB printers. To make normal users able to print this way add them to the group lp and make sure that the appropriate printer device file /dev/... is group-writable for the lp group. permissions queen πŸ‘‘

for a TCP/Socket/JetDirect printer with the host name printer listening on port 9100 you need this:

*FoomaticRIPPostPipe: "| /usr/bin/nc -w 1 printer 9100"

Note the "-w 1" in the "nc" command line β€” it makes "nc" exiting immediately after the data is transferred to the printer. bye, no lingering, we don't do that here ✌️

*FoomaticRIPPostPipe: "| rlpr -Plp@printserver"

directs your jobs to the LPD printer queue lp on the machine named printserver. chef's kiss πŸ“

See also http://www.openprinting.org/direct-doc.html


🌈 PRINTING WITH SPOOLER 🌈

See the documentation on the OpenPrinting Web site: http://www.openprinting.org/

that's it. that's the section. short and mysterious, we stan a minimalist 🧚


πŸ’œ CONFIGURATION FILE πŸ’œ

The file /etc/cups/foomatic-rip.conf or, if it is not readable, the file /etc/foomatic/filter.conf is read whenever foomatic-rip is executed. (yes, it checks the first one and falls back β€” thorough girly πŸ”) It allows one to configure the behavior of foomatic-rip as follows. also, lines beginning with # are comments and therefore get ignored, obviously πŸ’…

  • debug: 0|1 β€” Turns on (1) or off (0) the debug mode. This is equivalent to supplying the --debug command line option. Default setting is 0.
  • echo: [<path>/]<executable> β€” Sets the path to an echo(1) executable which supports -n.
  • gspath: [<path>/]<executable> β€” Sets the path to the Ghostscript (gs(1)) executable. To be used if Ghostscript is at a non-standard location or if an alternative Ghostscript should be used.
  • execpath: <path>[:<path>]... β€” Sets the $PATH variable to be used by foomatic-rip.
  • cupsfilterpath: <path>[:<path>]... β€” Sets the directories (colon-separated) in which foomatic-rip searches for CUPS filters.
  • preferred_shell: [<path>/]<executable> β€” Sets the preferred shell to use when executing FoomaticRIPCommandLine and friends. Several PPD files use shell constructs that require a more modern shell like bash, zsh, or ksh.

πŸŽ€ FILES πŸŽ€

  • /etc/cups/ppd/<printer>.ppd
  • /etc/direct/<printer>.ppd
The PPD files of the currently defined printers ✨
  • /etc/cups/foomatic-rip.conf
  • /etc/foomatic/filter.conf
Configuration file for foomatic-rip πŸ› οΈ

πŸ¦‹ EXIT STATUS πŸ¦‹

foomatic-rip returns 0 unless something unexpected happens. so if you see a zero, we're chilling. anything else? something went sideways bestie 😭


🌸 AUTHOR 🌸

Till Kamppeter <till.kamppeter@gmail.com> β€” with parts of Manfred Wassmanns's <manolo@NCC-1701.B.Shuttle.de> man pages for the Foomatic 2.0.x filters. legends, both of them πŸ‘‘πŸ‘‘


πŸ’– BUGS πŸ’–

None so far. (iconic, honestly πŸ’€)

Please send bug reports to the OpenPrinting bug tracker:

http://bugs.linuxfoundation.org/

Use "OpenPrinting" as the product and "cups-filters" as the component. that's the exact combo, don't mix it up bestie πŸ™ˆ


okay that's the whole page!! and for the cute sign-off: this gem is from the cups-filters fam, dated 2013-11-06, and honestly the information has been serving ever since πŸ’…βœ¨ 🫢

πŸ“¦ where this page comes from