I'm testing an application that sends PDFs to a printer, and it may request that multiple copies are printed, sending a command like

/usr/bin/lpr -T Document Title -# 10

I don't have access to a physical printer, so I'm using the CUPS generic virtual printer to "print" PDFs to disk. This works, however regardless of the number of copies requested, it only prints a single file.

$ echo hello > hello.txt
$ lpr -P PDF -T test -# 2  hello.txt 
$ ls PDF/

Is there a configuration that will respect the copies argument, for example creating hello-1.pdf and hello-2.pdf?

  • Distribution is Debian 9.
  • cups: 2.2.1-8+deb9u6
  • cups-bsd: 2.2.1-8+deb9u6
  • cups-pdf: 2.6.1-22
  • grep MaxCopies /etc/cups/cupsd.conf -> MaxCopies 100

No, there isn't such a configuration. Each time the spooler opens the output, writes the data, and closes the file. Next copy it does it again.

If you need multiple copies, print your data to PDF once, and use The PDF ToolKit, pdftk to multiply. Read man pdftk.


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.