The requirements for this project are: pypdf, dotenv
You can install them using this command:
pip install pypdf dotenv
At first, run the pdf.py file:
python3 pdf.py
You can optionally add the path of your pdf-file to the command, to specify which pdf-file should be edited (by default this pdf-file is "input.pdf"):
python3 pdf.py path_to_file.pdf
If the file is in the same directory as the python script, you can only write the pdf-file's name without the full path.
After you have start the script you will see something like this:
Filename..........my_file.pdf
/CreationDate.....D:20240107170843+01'00' [2024-01-07 17:08:43]
/Creator..........Writer
/Producer.........LibreOffice 7.6
---------- Menu ----------
[A]dd [E]dit [D]elete
[Q]uit
>
Now you can add, edit or delete the metadata keys and their values.
If you were asked to input the metadata key, you don't need to write the "/" at the beginning.
In additon, you don't need to write the full name of the key if the key is already unique:
Filename..........my_file.pdf
/CreationDate.....D:20240107170843+01'00' [2024-01-07 17:08:43]
/Creator..........Writer
/Producer.........LibreOffice 7.6
--------------------------
Metadata Key : Creat
"Creat" is not unique, because there are "CreationDate" and "Creator", but "Creato" and "Creati" are unique. So if you want to change the creator you only need to write "Creato" instead of "/Creator". (This is very useful if the key is very long, but unique after a few letters)
- You cannot change the
/CreationDateand the/ModDate.