pypdf
pypdf copied to clipboard
BUG: fix apperance stream options for forms
add apperance stream option to update_page_form_field_values. If true it generates apperance streams but only for one line. There are also issues with non-ascii characters not showing. This is a fix for #355.
Thank you for taking care of it :heart: It would be amazing if we could finally close this long-standing issue!
I'll try to test it on Saturday. In the mean time, would you mind to run black .
(installable via pip install black
) to get rid of the flake8 issues?
Codecov Report
Merging #1248 (abdee76) into main (cb6c224) will decrease coverage by
0.52%
. The diff coverage is6.66%
.
@@ Coverage Diff @@
## main #1248 +/- ##
==========================================
- Coverage 94.67% 94.14% -0.53%
==========================================
Files 30 30
Lines 4976 5006 +30
Branches 1025 1026 +1
==========================================
+ Hits 4711 4713 +2
- Misses 149 176 +27
- Partials 116 117 +1
Impacted Files | Coverage Δ | |
---|---|---|
PyPDF2/_writer.py | 87.45% <6.66%> (-4.10%) |
:arrow_down: |
Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.
Hoping for a quick integration and release. With this change I will start using PyPdf!
I will check the changes in https://github.com/Vigrond/PyPDF2/tree/appearance-stream made to my PR and integrate them. Maby we will find a solution for multi-line word px calculation and the encoding.
How are things going @fidoriel ?
Since my last message I did not invest time into this isssue. Not using external dependencies makes it very hard to calculate text px based on the font.
I understand that. Is there a specific external dependency that would help a lot?
@pubpub-zz Did you calculate the text px size anywhere already?
I think https://github.com/python-pillow/Pillow can do the job
And then there is the thing with special chraracters encoding where I have no idea
If you mean the Height, Yes : the function is available, for horizontal no. @fidoriel, It is a little easier and complex at the same time : widths are already provided in the fonts There is still some work to extract the data and compute for each line,
Sorry if this is a stupid question, but why is text measuring important? I thought the PDF reader takes care of form rendering? Asking because I'd rather have the form filling finally working than wait for edge-case fixes.
What is the state of this PR? Does it improve pypdf?
What is missing to get it merged? (besides resolving the merge conflict)?
My comany has decided to not use pypdf in our Project. What is needed:
- The calculation of the Font size/length and sentence breaks
- Encode Unicode correctly
- There are 2 forks of my brach wich might also help as far as I remember
- Testing that this really fix the issue on all PDF reader
My comany has decided to not use pypdf in our Project. What is needed:
* The calculation of the Font size/length and sentence breaks * Encode Unicode correctly * There are 2 forks of my brach wich might also help as far as I remember * Testing that this really fix the issue on all PDF reader
@fidoriel You should create some PR from your forks.
My comany has decided to not use pypdf in our Project.
I'm curious: Can you let me know (maybe in private; [email protected]) what you use instead?
I'm closing this PR now as it will likely never get merged. I'm sorry.
@pubpub-zz Maybe here are some ideas that would be useful for our current code base. If you do, please give credit in the commit so that we don't loose that information.
I've missed it a while ago (sorry about that @fidoriel) but it is another way to fill up forms. The current issues I'm facing are further than this (how to introduce a fulll range true type fonts to allow filling up with Arabic,... @fidoriel If you have any ideas about It will be welcomed