[ 
https://issues.apache.org/jira/browse/PDFBOX-5784?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17832195#comment-17832195
 ] 

Maruan Sahyoun commented on PDFBOX-5784:
----------------------------------------

I have a working solution which works better as the initial offset of the first 
character was calculated wrongly. All the other offsets, padding etc. match 
what Adobe generates. Unfortunately the initial offset still doesn't match the 
value to be compared with. I first need to generate more examples to understand 
the calculation better and reengineer from that.

> 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: 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]

Reply via email to