Replies: 1 comment
|
Hi, I found your thread after encountering this problem too. Try moving your const acrotext = acroform.createTextField(element.dataset.ffid);
acrotext.addToPage(
pdfpage,
{
x: csspx_to_pdfpt(element.offsetLeft),
y: (PAPER_HEIGHT_PT - csspx_to_pdfpt(element.offsetTop + element.offsetHeight) + 10),
width: csspx_to_pdfpt(element.offsetWidth),
height: csspx_to_pdfpt(element.offsetHeight),
font: font,
borderColor: PDFLib.rgb(0, 0, 1),
borderWidth: 1,
backgroundColor: PDFLib.rgb(0.95, 0.95, 0.95),
textColor: PDFLib.rgb(0, 0, 0),
}
);
if (element.tagName == "TEXTAREA")
{
acrotext.enableMultiline();
acrotext.setFontSize(12);
} |
0 replies
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.
Uh oh!
There was an error while loading. Please reload this page.
Hi,
Does anybody have an example of a form text field where you have successfully changed the font size? I have tried this:
However, I get the following error message on setFontSize on runtime:
Error: No /DA (default appearance) entry found for field: descriptionI have tried a bunch of different fixes (one of them inspired by another discussion, where the poster left saying they found a solution, but didn't share a code sample of it... always love to see it).
I haven't been able to find anything in the docs or using AI to fix this. My goal is simply to create a multi-line text field.

Maybe even one that automatically re-sizes the font based on how much text the input field contains - but I'll settle for just having an input field where the font doesn't scale to the height of the input.
All reactions