Open stlehmann opened 4 years ago
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 `
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
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?
Here are your options:
PyPDF2<3.0.0
PdfFileReader
by PdfReader
; potentially more); see https://github.com/stlehmann/pdftools/issues/17PyPDF2
by pypdf
+ step (2)
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