Closed boris-lok-pentadoc closed 1 month ago
This is not a bug. PyMuPDF only supports Helvetica, Times-Roman, Courier and ZapfDingbats as fonts for rendering fields. This is independent from the form fonts that may be already present in the PDF (and which are extracted into FormFonts
).
On updating a field, therefore automatically one of the supported 4 fonts is therefore chosen - ignoring any font specification that may already be there.
Thank you for your quick reply! I see.
I just found the wording in the documentation regarding it confusing, maybe I could submit a PR for it? It reads as if it is possible to use already embedded FormFonts
When specifying a text font for new or changed widgets, either choose one in the first table column (upper and lower case supported), or one of the already existing form fonts. In the latter case, spelling must exactly match.
To find out already existing field fonts, inspect the list Document.FormFonts.
I understand the confusion that this may cause. Thank you for your willingness to prepare a change in the documentation. Much appreciated!
Description of the bug
After updating Widgets value und calling
update()
method, the font value is reset, even though the font is present in FormFontsHow to reproduce the bug
Doc: VFNM-2018-05-22-mustervorlage-vorblatt.pdf
PyMuPDF version
1.24.2
Operating system
Linux
Python version
3.11