Hi Stefan!
Anno domini 2024 Sat, 30 Nov 12:18:58 +0100
Stefan Krusche via tde-users scripsit:
Good day everyone,
just to add to what has been said, to modify the PDF file to make it
readable by kpdf, see below…
Am Sonntag, 25. August 2024 schrieb E. Liddell via tde-users:
On Sun, 25 Aug 2024 12:32:04 +0200
"Dr. Nikolaus Klepp via tde-users" <users(a)trinitydesktop.org> wrote:
Hi all!
I just found that KPDF is (again) asking for a password on
non-password-protected PDFs and fails to open the PDF if no
password is given. The PDF preview in konqueror is fine. I have
attached a PDF that triggers the behaviour on my system (KPDF
14.2.0~pre65-0debian13.0.0+3~a).
Could somebody please verify?
The file is encrypted, which would explain the password:
$ pdfinfo ch32v003rm.pdf
Title: CH32V003RM-EN
Author: WCH
Creator: pdfFactory Pro pdffactorychina.cn
Producer: pdfFactory Pro 8.31 (Windows 11
CreationDate: Mon Mar 11 07:25:23 2024 EDT
Custom Metadata: no
Metadata Stream: no
Tagged: no
UserProperties: no
Suspects: no
Form: none
JavaScript: no
Pages: 185
Encrypted: yes (print:yes copy:yes change:no addNotes:yes
algorithm:AES-256) Page size: 595.32 x 841.92 pts (A4)
Page rot: 0
File size: 2283093 bytes
Optimized: no
PDF version: 1.7
$ pdfinfo ch32v003rm.pdf
Title: CH32V003RM-EN
Author: WCH
Creator: pdfFactory Pro pdffactorychina.cn
Producer: pdfFactory Pro 8.31 (Windows 11
CreationDate: Mon Mar 11 12:25:23 2024 CET
Custom Metadata: no
Metadata Stream: no
Tagged: no
UserProperties: no
Suspects: no
Form: none
JavaScript: no
Pages: 185
Encrypted: yes (print:yes copy:yes change:no addNotes:yes
algorithm:AES-256)
Page size: 595.32 x 841.92 pts (A4)
Page rot: 0
File size: 2283093 bytes
Optimized: no
PDF version: 1.7
# change the password with a 40 bit one
$ qpdf --allow-weak-crypto --encrypt '' '' 40 -- ch32v003rm.pdf
ch32v003rm.new.pdf
$ pdfinfo ch32v003rm.new.pdf
Title: CH32V003RM-EN
Author: WCH
Creator: pdfFactory Pro pdffactorychina.cn
Producer: pdfFactory Pro 8.31 (Windows 11
CreationDate: Mon Mar 11 12:25:23 2024 CET
Custom Metadata: no
Metadata Stream: no
Tagged: no
UserProperties: no
Suspects: no
Form: none
JavaScript: no
Pages: 185
Encrypted: yes (print:yes copy:yes change:yes addNotes:yes
algorithm:RC4)
Page size: 595.32 x 841.92 pts (A4)
Page rot: 0
File size: 2288192 bytes
Optimized: no
PDF version: 1.7
Now kpdf is able to open and show the file. See also:
https://mirror.git.trinitydesktop.org/gitea/TDE/tdegraphics/issues/29#issue…
HTH
Stefan
So this lead me to a viable solution to automatically remove those pesky passwords:
- Place the attached programm in your path
- make it executeable
In /opt/trinity/share/applications/tde/kpdf.desktop, change the "Exec=" to
this:
Exec=decrypt-pdf %U; kpdf %U %i -caption "%c"
... Now when KPDF opens a file it will first be sanitized (if possible) and then kpdf
opens the unlocked file. Not as clean as I would like it to be, but good enough for me :)
Nik
--
Please do not email me anything that you are not comfortable also sharing with the NSA,
CIA ...