[
https://issues.apache.org/jira/browse/PDFBOX-5784?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17834181#comment-17834181
]
Maruan Sahyoun commented on PDFBOX-5784:
----------------------------------------
I've fixed the character positioning and also added some code to draw the
dividers for comb fields if the field has border set which hasn't been done
before. There are edge cases which I need to look into in more detail - field
is not high enough and comb is smaller than character width. for these the
expected result can be seen in the right column of fields of the form template
which has been filled using Acrobat.
What we can also see in comparing the content streams is that the positions of
the characters are slighty different to how Acrobat places these. This is also
true for most of the other form filling results. It looks like Adobe is taking
additional/other font metrics into account than we do.
> AppearanceGeneratorHelper assumes fontscale 1000
> ------------------------------------------------
>
> Key: PDFBOX-5784
> URL: https://issues.apache.org/jira/browse/PDFBOX-5784
> Project: PDFBox
> Issue Type: Bug
> Components: AcroForm
> Reporter: Tilman Hausherr
> Assignee: Maruan Sahyoun
> Priority: Major
> Labels: Appearance
> Attachments: PDFBOX5784-template.pdf, screenshot-1.png,
> with_dividing_by_2.pdf, without_dividing.pdf
>
>
> The user in the attached SO question noticed that the comb adjustment needed
> a factor of 2 to work correctly. A look at the font shows UnitsPerEm = 2048.
> Sample code:
> {code:java}
> doc.getDocumentCatalog().getAcroForm().getField("field1").setValue("WWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWW");
> doc.getDocumentCatalog().getAcroForm().getField("field2").setValue("MMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMM");
> {code}
> !screenshot-1.png!
--
This message was sent by Atlassian Jira
(v8.20.10#820010)
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]