When trying to write a 40-character string in Courier New font size 18 in a field with the isComb attribute set, it was found that the last character was being cut off. example 1

During the experiments, I came to the conclusion that the reason is the incorrect calculation of the character width in the insertGeneratedCombAppearance(...) method of the org.apache.pdfbox.pdmodel.interactive.form.AppearanceGeneratorHelper class ( GitHub ) and as a result - incorrect calculation of the indentation for the first character. If I remove the division by 2, then everything starts working correctly. example 2

I ask for advice - is this really a mistake or does dividing by 2 make any sense in this case? If this is not a mistake, then what should be done? Examples of filling out the document in two ways are attached. template

0

There are 0 best solutions below