- Python 100%
|
0x4261756D
a8cd1a7f9d
Previously, some data (e.g. some info shown when clicking on something on a page in some PDFs) got lost when editing metadata. This is most likely a holdover behaviour from interfacing with pdfrw (the old library) which didn't have the capability to clone from a reader iirc. |
||
|---|---|---|
| .gitignore | Make -o optional if -f is provided | |
| LICENSE | Change to pypdf library + clean up -d + expand -i | |
| pdfutil.py | Clone whole document when changing infos, not just pages and metadata | |
| README.md | Change to pypdf library + clean up -d + expand -i | |
pdfutil
The original script (merging and rotating) was created in around two hours, information dumping and editing was "ported" from a previous project of mine in another two, so expect ugly code, dumb design decisions and be aware of the Nose Demons (although I doubt anyone will ever use this but who knows)... I had to merge PDFs and rotate them and somehow writing a python script was faster than finding an existing program doing that...
Version 1.x.x used the pdfrw library. Since that project seems abandoned and does not support all the features I want every later version uses pypdf.
Dependencies
- Python3 obviously
- pypdf
Installation instructions
Install Python
python3 -m pip install pypdf
Usage
python3 pdfutil.py -h
Examples
Update the title, author and creation date of test.pdf
python3 pdfutil -i test.pdf --title "Arnold Layne" --author "Syd Barret" --creation_date 19670310004156 -f
If against all odds someone really uses this and finds a bug, feel free to report it. In the even more rare case that you improved something, feel even more free to open a PR.