pdf-lib icon indicating copy to clipboard operation
pdf-lib copied to clipboard

Multiline Acrofield lineHeight

Open kimlambiguit opened this issue 6 years ago • 2 comments

I've created a js class to basically consolidate some of the snippets i found here. what it does is t accepts a pdf file with acrofields and an array of key:value pairs then fills up the fields with the associated key:val pair. I'm having a problem with setting the vertical distance for multiline fields. I tried setting the lineHeight to various value but the output is still the same. my request/issue would be:

  1. i am not able to set the distance between each line. i've tried setting the lineHeight with different values but the output seems to be the same.

  2. is it possible for example if you have a very long field and only 3 lines of multiline text, we can position it vertically in the center?

Thank you.

kimlambiguit avatar Jun 10 '20 11:06 kimlambiguit

https://www.dropbox.com/s/xu9fat1go4ecm8r/PdfReader.js?dl=0 link to the PdfReader class. doesn't seem to follow whatever i set in the textFieldAppearanceStream function. regardless of the values in lineHeight, x, y, it'll display the same

kimlambiguit avatar Jun 10 '20 13:06 kimlambiguit

Hello @kimlambiguit! pdf-lib has a new forms API that should solve this problem for you. Please see the README and API docs for details.

Hopding avatar Sep 20 '20 19:09 Hopding