3

I'm getting a strange behavior with the lp command on Mac OS Catalina. I have a 12-page PDF file and want to print all pages in the PDF. I'm hoping to print hundreds of PDFs using lp or lpr with a variable number of pages.

The following only prints the first page:

lp -d MY_PRINTER -o fit-to-page -o media=A4 myfile.PDF 

These commands also only print the first page:

lp -d MY_PRINTER -o fit-to-page -o media=A4 myfile.PDF -o page-ranges=1-999999 lp -d MY_PRINTER -o fit-to-page -o media=A4 myfile.PDF -o page-ranges=1-12 

But strangely, this command prints pages 3-12:

lp -d MY_PRINTER -o fit-to-page -o media=A4 myfile.PDF -o page-ranges=3-999999 

Does anyone know how to force lp (or lpr) to print all N pages of a PDF?

1
  • When using lp from the package cups-client (version 2.4.7-1.2ubuntu7.3) in Ubuntu 24.04.1 LTS, I could print all pages of a PDF using this command: $ lp -d <name of the printer> -o fit-to-page <path-to-pdf>, so I suspect the issue you are having is related to a bug that exists in that specific version for Mac OS Catalina. Commented Dec 31, 2024 at 23:13

0

You must log in to answer this question.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.