Skip to content

What is cupsfilter MacOS command?

cupsfilter is a command-line tool on MacOS that converts file formats for printing using the Common Unix Printing System. By utilizing cupsfilter, users can effortlessly convert files to a format supported by their printer for seamless printing.

cupsfilter Syntax:

Terminal window
cupsfilter [options] [filename]

cupsfilter Options:

OptionDescription
-kKeep temporary files after filtering
-mMIME media type of the input file
-pPrinter to use
-iNumber of copies to make
-#Number of pages to print
-nNumber-up printing
-oprinter-option=value
-Ddebug-level
-Jjob-name
-PDocument format
-UUsername for print job

Parameters:

ParameterDescription
filenameThe file to be filtered

cupsfilter Command Usage Examples:

Convert a PDF file to PostScript format

Terminal window
cupsfilter -m application/pdf mydocument.pdf > mydocument.ps

Converts a PDF file named “mydocument.pdf” to PostScript format and saves it as “mydocument.ps”.

Convert a Word document to PDF format

Terminal window
cupsfilter -m application/vnd.openxmlformats-officedocument.wordprocessingml.document mydocument.docx > mydocument.pdf

Converts a Word document named “mydocument.docx” to PDF format and saves it as “mydocument.pdf”.

Terminal window
cupsfilter mytextfile.txt | lpr

Prints a plain text file named “mytextfile.txt” directly to the default printer.

Convert an image file to PDF format

Terminal window
cupsfilter -m image/jpeg myimage.jpg > myimage.pdf

Converts an image file named “myimage.jpg” to PDF format and saves it as “myimage.pdf”.

Display the supported print job options

Terminal window
cupsfilter -O list

Displays the supported print job options that can be used with the cupsfilter command.

How do I use cupsfilter in MacOS?

To use the cupsfilter command in bash, execute the following command:

Terminal window
cupsfilter --help

What options are available in cupsfilter for MacOS?

To view the available options in cupsfilter, use the following command:

Terminal window
cupsfilter --list-conversions

How do I convert a print file using cupsfilter in MacOS?

To convert a print file using cupsfilter, run the command with the appropriate options like this:

Terminal window
cupsfilter -m <media-type> -o <options> <file>

How can I specify the output format when using cupsfilter in MacOS?

You can specify the output format by providing the desired MIME type as follows:

Terminal window
cupsfilter -m <output-MIME-type> <file>

How do I print a file directly using cupsfilter in MacOS?

To print a file directly using cupsfilter, you can utilize the -d <printer> option like this:

Terminal window
cupsfilter -d <printer> <file>

Can I specify the printer destination when using cupsfilter in MacOS?

Yes, you can specify the printer destination using the -d <destination> option. Here is an example command:

Terminal window
cupsfilter -d <destination> <file>

How do I check the available MIME types for use with cupsfilter in MacOS?

You can check the available MIME types supported by cupsfilter by running the following command:

Terminal window
cupsfilter -T

How do I specify custom filter options with cupsfilter in MacOS?

To specify custom filter options in cupsfilter, use the -o flag followed by the desired options like this:

Terminal window
cupsfilter -o <option1>=<value1> -o <option2>=<value2> <file>

Applications of the cupsfilter macOS command

  • Convert from one document format to another
  • Prepare a document for printing on a CUPS-supported printer
  • Extract and filter content from documents before printing
  • Send a print job from the command line