#1072743 texlive-extra-utils: pdfxup: --pages option fails if page range omits start or end of range

#1072743#5
Date:
2024-06-07 11:09:07 UTC
From:
To:
The man entry for pdfxup says that --pages can handle an omitted start
or end of range, e.g. "--pages 2-" or "--pages -5".  However, using the
following pdf file as a test (it's one page long) gives an error
if either the start or end of the range is omitted.

Omitting the end of the range:

$ pdfxup --pages 1- /usr/share/cups/data/default-testpage.pdf
-> processing options
/usr/bin/pdfxup: line 405: [[: 1-: syntax error: operand expected (error token is "-")
   /usr/share/cups/data/default-testpage.pdf has 1 page(s); pages 1- do not exist.
/usr/bin/pdfxup: line 405: [[: 1-: syntax error: operand expected (error token is "-")
   /usr/share/cups/data/default-testpage.pdf has 1 page(s); pages 1- do not exist.
   No pages to include. Aborting.

Omitting the start of the range also fails:

$ pdfxup --pages -1 /usr/share/cups/data/default-testpage.pdf
Error: option '--pages' expects a range, not '-1'.
Aborting.

But omitting both start and end works as described in the man page:

$ pdfxup --pages - /usr/share/cups/data/default-testpage.pdf
-> processing options
-> computing bounding box.
-> producing final file
   final scale: 95.35675%
-> cleaning

#1072743#10
Date:
2024-06-07 13:48:04 UTC
From:
To:
On 07.06.2024 13:09, Sanjoy Mahajan wrote:

Hi,
Are you willing to discuss this with the upstream author?

https://www.ctan.org/tex-archive/support/pdfxup

Thanks,
   Hilmar

#1072743#15
Date:
2024-06-08 08:24:46 UTC
From:
To:
Yes, I'll be happy to discuss it with upstream.
Should I CC you?  Or just update the Debian bug as needed?

#1072743#20
Date:
2024-06-08 08:33:32 UTC
From:
To:
08.06.2024 10:25:00 Sanjoy Mahajan <sanjoy@mit.edu>:
I'm one of the TL maintainers, so keeping the bug in Cc is sufficient. Thanks.

Hilmar

#1072743#25
Date:
2024-06-08 13:59:50 UTC
From:
To:
Thanks Sanjoy, much appreciated!

Best regards

Norbert

#1072743#30
Date:
2024-06-10 06:48:16 UTC
From:
To:
Dear Nicolas,

I found a small bug in the TL pdfxup (on Debian) and filed a Debian bug
report.  The Debian TL maintainers suggested that I discuss it with you
as upstream, as the bug is likely upstream.

The bug report is in the Debian BTS:
<https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=1072743>

But here is a copy of that report:

The man entry for pdfxup says that --pages can handle an omitted start
or end of range, e.g. "--pages 2-" or "--pages -5".  However, using the
following pdf file as a test (it's one page long) gives an error
if either the start or end of the range is omitted.

Omitting the end of the range:

$ pdfxup --pages 1- /usr/share/cups/data/default-testpage.pdf
-> processing options
/usr/bin/pdfxup: line 405: [[: 1-: syntax error: operand expected (error token is "-")
   /usr/share/cups/data/default-testpage.pdf has 1 page(s); pages 1- do not exist.
/usr/bin/pdfxup: line 405: [[: 1-: syntax error: operand expected (error token is "-")
   /usr/share/cups/data/default-testpage.pdf has 1 page(s); pages 1- do not exist.
   No pages to include. Aborting.

Omitting the start of the range also fails:

$ pdfxup --pages -1 /usr/share/cups/data/default-testpage.pdf
Error: option '--pages' expects a range, not '-1'.
Aborting.

But omitting both start and end works as described in the man page:

$ pdfxup --pages - /usr/share/cups/data/default-testpage.pdf
-> processing options
-> computing bounding box.
-> producing final file
   final scale: 95.35675%
-> cleaning


I am happy to test any patches.

Best regards,
-Sanjoy

#1072743#35
Date:
2024-06-13 14:58:17 UTC
From:
To:
I've discussed it with the upstream author, Nicolas Markey.  He has
fixed that bug and a few others, and the new version works on my tests
too.  That version (v2.12) will be (or has been?) submitted to CTAN.
Meanwhile, here is the .zip file of that version that Nicolas sent me
(and I tested):

#1072743#40
Date:
2026-04-24 19:19:38 UTC
From:
To:
Am 10.06.2024 um 08:48 schrieb Sanjoy Mahajan:

Hello Sanjoy,
Did you ever get a response to your report?

Hilmar