Open gioppoluca opened 10 months ago
I'm using the acroform's fields to fill an existing PDF module. The resulting module looses the original font of the module and gets Helvetica.
field.setText();
The resulting module looses the original font of the module and gets Helvetica.
The field keeps its original font. Also I'm unable to retrieve the used font from any available API.
I use LibreOffice to create a module, assign a different font and create the PDF. Also tried to modify the PDF with acrobat and altering the font again, with no luck. You can see the PDF here: https://github.com/gioppoluca/sheet-export/blob/master/mappings/dnd5e/experimental/latest/5e-model.pdf
1.17.1
Browser
Is there an API to retrieve the original font used?
I encountered the same issue and found following solution when the font was previously embedded using pdf-lib. See also my comment here.
// Get embedded font using code from above comment field.setText(newText); field.updateAppearances(font);
What were you trying to do?
I'm using the acroform's fields to fill an existing PDF module. The resulting module looses the original font of the module and gets Helvetica.
How did you attempt to do it?
field.setText();
What actually happened?
The resulting module looses the original font of the module and gets Helvetica.
What did you expect to happen?
The field keeps its original font. Also I'm unable to retrieve the used font from any available API.
How can we reproduce the issue?
I use LibreOffice to create a module, assign a different font and create the PDF. Also tried to modify the PDF with acrobat and altering the font again, with no luck. You can see the PDF here: https://github.com/gioppoluca/sheet-export/blob/master/mappings/dnd5e/experimental/latest/5e-model.pdf
Version
1.17.1
What environment are you running pdf-lib in?
Browser
Checklist
Additional Notes
Is there an API to retrieve the original font used?