-
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
Sel fontinfields #2064
base: main
Are you sure you want to change the base?
Sel fontinfields #2064
Conversation
/uniHHHH glyphs seems to be generated in laTeX but is ok for other characters addressed partially in py-pdf#2016
Co-authored-by: Martin Thoma <[email protected]>
Co-authored-by: Martin Thoma <[email protected]>
Co-authored-by: Martin Thoma <[email protected]>
Codecov ReportPatch coverage:
Additional details and impacted files@@ Coverage Diff @@
## main #2064 +/- ##
==========================================
- Coverage 94.17% 94.16% -0.02%
==========================================
Files 41 41
Lines 7333 7370 +37
Branches 1442 1456 +14
==========================================
+ Hits 6906 6940 +34
- Misses 266 267 +1
- Partials 161 163 +2
☔ View full report in Codecov by Sentry. |
I still tring to find a way to add capability to introduce full range TTF into the pdf |
@Lucas-C |
@Lucas-C |
Hi @pubpub-zz! Unless one of the other maintainers answers you over the week-end, |
# for x in range(32): | ||
# enc = enc.replace(bytes((x,)),b"\%03o"%x) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe those debug lines should be removed before merging this PR?
font_full_rev.get(c, c.encode("utf-16-be")) for c in line | ||
] | ||
if any(len(c) >= 2 for c in enc_line): | ||
ap_stream += b"<" + (b"".join(enc_line)).hex().encode() + b"> Tj\n" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Codecov reports that this line is never evaluated in pypdf
test suite:
do you think a unit test could be added to cover this case?
@@ -934,8 +988,14 @@ def update_page_form_field_values( | |||
Args: | |||
page: Page reference from PDF writer where the | |||
annotations and field data will be updated. | |||
fields: a Python dictionary of field names (/T) and text | |||
values (/V) | |||
fields: a Python dictionary of : |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe the type of the fields
parameter on line 978 should reflect those options?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I made a few comments, but overall this seems like a great PR to me!
Maybe you should also include a mention of this change in CHANGELOG.md
& add an extra example in docs/user/forms.md
?
writer = PdfWriter(clone_from=RESOURCE_ROOT / "FormTestFromOo.pdf") | ||
writer.update_page_form_field_values( | ||
writer.pages[0], | ||
{"Text1": ("Text", "", 5), "Text2": ("Text", "/F1", 15)}, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@Lucas-C |
@pubpub-zz There wasn't an update in this PR in a long time + there are several merge conflicts. Should we close the PR? |
No, I will try to rework on it |
add capability to change font and size
closes #2253