FIX: Escape encrypted strings #3587
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Hey,
We are using this package to generate encrypted documents and it works fine for some time now. Lately we found 1 case where opening it in Adobe Reader displays blank pages, but it still looks fine in Google Chrome for example.
Checking the PDF with
qpdfgave the following warnings:Checking the mentioned objects(11 and 30) we have noticed that not all encrypted strings are escaped properly:
Both objects are the same unencrypted:
The encrypted version:
The problem is that the
/Orderingstring value contains0x29and0x28which are the opening and closing parenthesis. Some readers fail to handle it and they doesn't render the document properly.After checking the whole file I've found a couple places where the
filterTextcall was missing and added them where it seemed necessary to escape these strings properly.