I am using the comming line ipptool for printing, which is a low-level tool in the CUPS daemon for internet printing.

IPP is a HTTP-based protocol for internet printers, most current LAN-based office printers are supporting it.

I used the following command for print:

ipptool -tv -f /path/to/my.pdf ipp://myprinter.on.mylocal.net/ipp/ printfile.ipp

Where my printfile.ipp defines the characteristics/capabilities of my printer, as follows:

GROUP operation-attributes-tag
ATTR charset attributes-charset utf-8
ATTR language attributes-natural-language en
ATTR uri printer-uri $uri
FILE $filename

What I know for sure:

  1. Single-sided PDF printing is working seamlessly.
  2. The printer is a relative ordinary HP office printer,
  3. Which is capable to print double-sided without any problem (co-workers with Windows can do that).

I found this printfile with google and seems working, however any deeper digging about its exact format and specification resulted only cloudy specs and docs. Even the name of the file format of this IPP file is unclear for me.

How could I make it to print double-sided?


Using ipptool, you can configure a job to use duplex printing by adding

ATTR keyword sides two-sided-long-edge


ATTR keyword sides two-sided-short-edge

to the job description, depending on the layout you want.

See RFC 2911 for details.


While @StephenKitt's answer of course is correct, I want to add a few details:

  1. The line he suggested HAS to appear after the two lines with ATTR charset ... and ATTR language ....

  2. The filename can be anything you want. You could name it, for example, ipp-print-duplex.txt.

  3. The file format specification can be found by reading man ipptoolfile on any Linux system. (It ships as part of any package that also ships ipptool itself.)

  4. Invoke it like this:

    ipptool -t -v -f my.pdf <device-uri> ipp-print-duplex.txt

    where you use as the <device-uri> value exactly the same string which you get returned when you call ippfind (which should also have been shipped alongside ipptool itself).

  • Thank you very much! It helped a lot. Some HP printers have a habit, that they give an error for this setting. However, it can be set up in their webadmin control panel. – peterh Jun 19 '19 at 10:23
  • Looks correct, but when sent to a Xerox Versalink, I get response sides (unsupported) = unsupported, so did not work. Nice to hear if it works with other vendors like HP. Please report. – sekrett Feb 11 at 13:01
  • @sekrett: Never heard of Versalink. You sure it supports duplex printing? You could use this command to query all supported print options directly from any IPP-capable device: ipptool -t -v <device-uri> get-printer-attributes.test. – Kurt Pfeifle Feb 11 at 17:25
  • Yes, it supports, when I print from Windows or through Cups, but directly does not work, it explicitly refuses. The fun part is get-printer-attributes claims support of sides. Firmware is the latest, in web admin nothing special to configure for IPP. – sekrett Feb 12 at 7:19

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.