Hello, I have a very simple use-case for a filling up an acroform. I have a non-multi line text field. I would like to resize the font size to fit in the width of the text field.
The PDF spec mentions that a font size of 0 implies auto fit to width. However PDFBox - 1419 & PDFBOX-1402 mention that this isn’t supported in pdfbox. Hence I have some small logic to calculate the font-sizes based on the widths etc. However I’m facing problems setting the font size. I’m seeing the behavior mentioned in PDFBox - 1419 > Starts out with incorrect font size. If I click into the field, it displays > correctly. Click outside the field, it reverts back to the wrong display. Code : pdfFormField.getDictionary.setString(COSName.DA, "/Helv 10 Tf 0 g”) Any pointers or help would be much appreciated.

