PDF Files That Have Obnoxious Security Features: Difference between revisions

Created page with "...let's solve that problem; For Rocky Linux 9; <code>dnf dnf install -y python3-pip perl-Image-ExifTool qpdf</code> The below script actually works (but could be improved) ...just change permissions chmod 755 WhatEverPYName.py, and then: ./WhatEverPYName.py<syntaxhighlight lang="text"> python3 - << 'PY' from pikepdf import Pdf, Name src = "cs.pdf" dst = "cs_unlocked.pdf" with Pdf.open(src) as pdf: # Get catalog (Root) via trailer — works across pikepdf versions..."
 
mNo edit summary
 
(One intermediate revision by the same user not shown)
Line 4: Line 4:


<code>dnf dnf install -y python3-pip perl-Image-ExifTool qpdf</code>
<code>dnf dnf install -y python3-pip perl-Image-ExifTool qpdf</code>
<code>pip3 install --user pikepdf</code>


The below script actually works (but could be improved)
The below script actually works (but could be improved)


...just change permissions chmod 755 WhatEverPYName.py, and then: ./WhatEverPYName.py<syntaxhighlight lang="text">
...just change permissions chmod 755 WhatEverPYName.py, and then: ./WhatEverPYName.py
 
<nowiki>***</nowiki>Keep in mind there is a 'funky hoop jumping thing' if using Adobe Acrobat "classicish" version, where if you want to change say the Document Title, do the following;
 
* Open the File
* Select File, Properties, Security Tab, Change Settings (enable everything, set a blank or WhatEver Password)
* Save the File
* Reopen the File
* Select File, Properties, Security Tab, Change Settings, just click OK, then OK again.
* Select File, Properties, Security Tab, Change Settings (yes again, back to the same place), Description Tab
* It is now editable (for now, rinse and repeat for later)
<syntaxhighlight lang="text">
python3 - << 'PY'
python3 - << 'PY'
from pikepdf import Pdf, Name
from pikepdf import Pdf, Name