Hopding / pdf-lib

Create and modify PDF documents in any JavaScript environment
https://pdf-lib.js.org
MIT License
6.74k stars 645 forks source link

Is it possible to set line height using text field? #1536

Open dimaskc opened 10 months ago

dimaskc commented 10 months ago

What were you trying to do?

How to set line height in text field?

image

How did you attempt to do it?

form.getTextField('property_appointment')
        .setText(`lorem ipsum dolor sit amet lorem ipsum dolor sit amet lorem ipsum dolor sit amet ${jsonData?.property?.appointment} lorem ipsum dolor sit amet lorem ipsum dolor sit amet ${jsonData?.property?.appointment} lorem ipsum dolor sit amet lorem ipsum dolor sit amet ${jsonData?.property?.appointment} lorem ipsum dolor sit amet`);

What actually happened?

setLineHeight() doesn't work

What did you expect to happen?

I want to set custom line height

How can we reproduce the issue?

-

Version

1.17.1

What environment are you running pdf-lib in?

Node

Checklist

Additional Notes

No response

BrunnerLivio commented 7 months ago

Someone found a solution for this? I can't seem to figure out how to set it in either Adobe Acrobat nor setting it programmatically using PDF-Lib, so that pdfDoc.getForm().getTextField('my-field').setText('Value') has a bigger line-height.