-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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
Can't Fill PDFs without /DR dictionary #2670
Comments
Updates the _writer.py to create the /DR and /Font dictionaries, and add a font (Helvetica) if they don't exist. This enables filling out PDF forms.
- Added test - Cleaned up code (simplified and fixed variable name)
first this PDF is very odd : out of the /DR entries missing, the names ("/T") contains . which is banned by PDF spec. About the missing fonts, we can cope with this situation if the font belongs to the 14 standard Type 1 fonts I will propose an alternative PR with this solution |
my test code and output file:
|
I am trying to fill out a PDF form, but running into an issue where the /Font dictionary is not populated, so nothing can be written to the PDF.
Environment
Which environment were you using when you encountered the problem?
Code + PDF
This is a minimal, complete example that shows the issue:
Share here the PDF file(s) that cause the issue. The smaller they are, the
better. Let us know if we may add them to our tests!
f1040.pdf
Traceback
This is the complete traceback I see:
For reference, adding the following code to the _writer.py file fixes the issue:
The text was updated successfully, but these errors were encountered: