Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update writer class #2606

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open

Update writer class #2606

wants to merge 1 commit into from

Conversation

HannahNgx
Copy link

Added correct_annotation_encodings method in writer class to automatically deal with issue where output PDF form with undefined '/Encoding' in the "/DR" section in the fields/annotations.
It will be called in the clone_document_from_reader after clone_reader_document_root is called

Added correct_annotation_encodings method in writer class to automatically deal with issue where output PDF form with undefined '/Encoding' in the "/DR" section in the fields/annotations
@stefan6419846
Copy link
Collaborator

Thanks for your PR. Could you please add an example file as well? Additionally, I do not really like the deep nesting. Are you able to simplify this with early exits?

@pubpub-zz
Copy link
Collaborator

@HannahNgx
a) Are you dealing with #2577 ? if so, please update your first comment to address it
b) Are you facing this issue on other documents to propose such a PR?

The issue #2577 is dealing with a "damaged" PDF which is not respecting the PDF format : the "/Encoding" tag is not at the good position ("/DR" should not include an encoding field, but it should be within font). I see no reason to call your new correct_annotation_encodings on each import : We may have undetected side effects.

From my point of view, instead of adding a very specific repair tool, it might be better to fix the creation tool. Else It might be better to propose it as a tool included in https://github.com/py-pdf/pdfly

@stefan6419846 stefan6419846 added the needs-discussion The PR/issue needs more discussion before we can continue label Apr 28, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
needs-discussion The PR/issue needs more discussion before we can continue
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants