Tu sei qui
Home › Forum home › PDF Property Extension › Bug reports › Properties not displayed for Protected PDFs ›Properties not displayed for Protected PDFs
Please let our ADS show!
This sites offers only FREE software and it's supported by a few advertisement boxes (no intrusive popups).
Please:
- disable your AdBlocker by adding CoolSoft website to whitelist
- give the proper cookie consent
- enable JavaScript for this website
This seconds wait is to let you update your browser configuration...
Ok, I've done the required changes... now show me your content!- FredJ
- Posts: 5
- Joined: 14 Mar 2020 - 16:18
- coolsoft
- Posts: 1978
- Joined: 25 Mar 2012 - 01:19
Please post a sample PDF document here to reproduce the issue (the smaller the better, no sensitive data, ZIP compressed).
This way I'm sure to work on the right file and, also, if I can fix it we'll have an "official" test file ;)
- FredJ
- Posts: 5
- Joined: 14 Mar 2020 - 16:18
Hello,
thank you for your reply. I had problems to login and sent you some test files via the contact form.
I think the problem is easy to solve: The metadata is UTF-16 BE encoded in these cases. If you see the BOM at the start of the string, just decode the following 16 bit BE chars.
Here is annother file, which will make this clear: I entered Euro signs for metadata title, keywords ...
As Euro is Unicode 0x20AC, you will see in the Explorer a space followed by a logic not sign for each €.
Have a nice day and keep healthy,
Fred
- Attachments (Only registered users)
- PDFTestEuro.zip
- coolsoft
- Posts: 1978
- Joined: 25 Mar 2012 - 01:19
FredJ wrote:I think the problem is easy to solve
No, it's not ;)
The four '€' chars in Title property are stored liks this in the encrypted PDF file
0x99AB4704EEF4CCCCC050 <-- (offset 0x5FD0 in your pdf file)
This is the encrypted version of the "€€€€" title string.
Decrypting it requires a lot of work, starting from reading owner password from Encrypt dictionary, reversing it then applying to all of the strings in the file.
Will have a look, but it's not a simple UTF-16/Encoding issue...
- FredJ
- Posts: 5
- Joined: 14 Mar 2020 - 16:18
Hello!
You wrote:
Decrypting it requires a lot of work, starting from reading owner password
from Encrypt dictionary, reversing it then applying to all of the strings in
the file.
Yes. I did not mean, that *decrypting* is easy.
Your extension is doing this fine, also with these testfiles!
By the way, where did you get the information how to do this?
Looking at the strings of the last testfile displayed in the Explorer, I see that they are decoded correctly.
But they are displayed byte by byte as if they were ANSI, including the BOM. It seems that the program does not expect UTF-16 BE.
If a string uses ASCII chars only, the next byte after the BOM is always 0 with BE. So only the BOM is displayed.
So what I think is easy, is to look for a BOM, remove it and convert the string to UTF-16 LE (Windows Unicode).
Thank you,
Fred
- coolsoft
- Posts: 1978
- Joined: 25 Mar 2012 - 01:19
Well, it was easier than I thought (and you were partially right ;))
PDF encrypted objects support was already added back in v.1.10.0, but limited to unencoded ANSI strings, due to limitations in an internal class.
I've extended UTF support to all of the PDF objects, being them encrypted or not... ;)
Just released version 1.14.0 with the new feature added.
Thanks for your detailed report; it helped me a lot to fix the issue quickly.
Cheeers
- FredJ
- Posts: 5
- Joined: 14 Mar 2020 - 16:18
Hello,
just installed the new version. Works with all my PDFs.
May I ask, where did you get the information how to do the decryption?
Mille grazie!
Fred
- coolsoft
- Posts: 1978
- Joined: 25 Mar 2012 - 01:19
I've used the official PDF reference documentation available from Adobe website:
https://www.adobe.com/devnet/pdf/pdf_reference.html
And a great help came from Stackoverflow.com ;)
- FredJ
- Posts: 5
- Joined: 14 Mar 2020 - 16:18
Hello,
thank you for your interesting reply and for the update in such a short time!
Buona serata,
Fred
Navigazione
Login
Clicca qui per supportare il mio lavoro con PayPal
oppure offrimi un caffè