Hi,

Thanks; please post attach your text and the patch to the issue you mentioned. This way it is easier to communicate with you and and the coments will be there as long as the bug tracker exists. If possible, avoid making formatting changes to code that you didn't touch.

Tilman

Am 17.06.2020 um 15:48 schrieb Sebastian Fieber:
Hey,

we are using PDFBox for one of our products and have a proposed
improvement for PDFBOX-3812.

The problem we are facing with the current implementation of
auto-sized multiline text fields is the following:

1. If the rectangle of the multiline text field has a reasonable height
    for a few lines and only a few characters are put in the text field
    the font will get too big, resulting in strange looking input.  If
    edited aftewards with Adobe Acrobat the font size is adjusted to 12pt
    (like the DEFAULT_FONT_SIZE).

2. Words are not broken if they are too long to fit in the width of the
    textbox.  The result is that the part not fitting is cut off.

The attached patch tries to fix these issues in the following way:

1. Use DEFAULT_FONT_SIZE instead of MAX_FONT_SIZE to calculate the
    maximum line height for multiline text fields

2. Test if a word is longer than the width if it is the only word
    present on a line.  If yes a similar alorithm to calculate the font
    size in 1. is used.

If there are any problems with the patch, please let me know.



---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to