Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

cat command fails to execute with negative page slice #44

Open
capricorn opened this issue Feb 22, 2024 · 1 comment
Open

cat command fails to execute with negative page slice #44

capricorn opened this issue Feb 22, 2024 · 1 comment

Comments

@capricorn
Copy link

$ python3 -m pdfly --version
pdfly 0.3.0
  using pypdf==4.0.2

My understanding is that the following command should extract the last page of the PDF:

$ python3 -m pdfly cat resources/GeoBase_NHNC1_Data_Model_UML_EN.pdf -o geo.pdf -1
Error
No such option: -1

I've tried passing the quoted form '-1' as well but that doesn't seem to help. Positive integers work just fine.

Ranges also fail:

$ python3 -m pdfly cat resources/GeoBase_NHNC1_Data_Model_UML_EN.pdf -o geo.pdf -2:
Error
No such option: -2
@capricorn
Copy link
Author

Well, following tiangolo/typer#134 (comment) this works:

$ pdfly cat resources/GeoBase_NHNC1_Data_Model_UML_EN.pdf -o /tmp/geo.pdf -- -1

In that case the examples for $ pdfly cat --help just need updated?

@capricorn capricorn changed the title cat command fails to execute with negative page offset cat command fails to execute with negative page slice Feb 22, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant