Set font size of form field, for text to fit box? #1245
Unanswered
yaakovyitzchak
asked this question in
Q&A
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
BH
I'm trying to make a basic application that allows users to automatically fill in the form fields of a PDF based on input data [i.e., a CSV with the form values]. Since it should be filling in lots of fields automatically, without knowing what the content of each field would be, I would like to have a way to set the font size of each text field to be such that all of the text will fit within the field [the input PDF already has the form created and everything].
Any way to do this?
I'm using fontkit, for example, the function that sets the fields is the following [srcDoc is the PDFLib document with built in fields]:
"flatasize" is a function based on another thread here to proerly update the fields:
when I embed the font in the PDF earlier, the code is:
the rest of my code is secret for my project so I would prefer not to upload it, but I have to upload something to post
BH.txt
Beta Was this translation helpful? Give feedback.
All reactions