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

add won't parse arguments the right way #11

Open
stlehmann opened this issue Sep 9, 2020 · 4 comments
Open

add won't parse arguments the right way #11

stlehmann opened this issue Sep 9, 2020 · 4 comments
Labels

Comments

@stlehmann
Copy link
Owner

If I do something like this:

pdftools add -o output.pdf input.pdf

I will get the following error:

pdftools add: error: the following arguments are required: src

@stlehmann stlehmann added the bug label Sep 9, 2020
@stlehmann stlehmann changed the title pdftools --add won't parse arguments the right way add won't parse arguments the right way Sep 9, 2020
@kwmartin
Copy link

I have the same problem
`

pdftools copy -p 208-209 dest.pdf sob_master_20221201.pdf
usage: pdftools copy [-h] [-o OUTPUT] [-p PAGES [PAGES ...]] [-y] src
pdftools copy: error: the following arguments are required: src
and
pdftools copy -o tmp.pdf -p 208-209 sob_master_20221201.pdf
usage: pdftools copy [-h] [-o OUTPUT] [-p PAGES [PAGES ...]] [-y] src
pdftools copy: error: the following arguments are required: src
`

@kwmartin
Copy link

Looked into it a bit. 1) when using copy there is no dest, 2) the way the argument parser is written, the src file must be before the "flag" arguments., and 2) on line 266 of the version that comes in with pip, we have:
pdf_copy(ARGS.input, ARGS.output, ARGS.pages, ARGS.y) as compared to the repo which has
pdf_add(ARGS.dest, ARGS.src, ARGS.pages, ARGS.output). ARGS which is 'Namespace' object has no attribute 'input'. Basically, not currently useable at least with the version coming in with pip

@kwmartin
Copy link

Did a pip uninstall, cloned repo, did a sudo python3 setup.py install which worked. Tried running and got:
PyPDF2.errors.DeprecationError: PdfFileReader is deprecated and was removed in PyPDF2 3.0.0. Use PdfReader instead.
Oh well! I guess you get what you pay for?

@MartinThoma
Copy link

MartinThoma commented Dec 30, 2022

Here are your options:

  1. Downgrade to PyPDF2<3.0.0
  2. Upgrade your code (replace PdfFileReader by PdfReader; potentially more); see Update to latest PyPDF2 #17
  3. Replace PyPDF2 by pypdf + step (2)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants