[ 
https://issues.apache.org/jira/browse/PDFBOX-1900?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

John Hewson updated PDFBOX-1900:
--------------------------------
    Attachment: afm-stretch.patch

That's actually a bug. When a substituted glyph's width doesn't match the width 
in the PDF, we stretch the glyph to fit, which is the sam behaviour as Adobe 
Acrobat.

However, there's a flaw in the design of getWidthFromFont() which means that it 
doesn't work for "standard 14" fonts which get their widths from AFMs. I've 
attached a patch which fixes it, but you should probably test it as it might 
well alter other renderings.

With the patch applied, the diamond is in the centre as expected, it's slightly 
stretched (there's nothing that can be done about that - Acrobat only scales 
widths, not heights, so we must do the same). So it no longer looks weird, 
though it's not perfect.

> ConvertToImage - pdf - checkbox wrongly rendered 
> -------------------------------------------------
>
>                 Key: PDFBOX-1900
>                 URL: https://issues.apache.org/jira/browse/PDFBOX-1900
>             Project: PDFBox
>          Issue Type: Bug
>          Components: Rendering
>    Affects Versions: 1.8.3, 2.0.0
>            Reporter: foxkeh
>            Assignee: John Hewson
>              Labels: Dingbats, Zapf
>             Fix For: 2.0.0
>
>         Attachments: PDFBOX-2192-006972.pdf-24-MSGothic.png, 
> afm-stretch.patch, annots.pdf-6-ArialUnicode.png, annots.pdf-6-MSGothic.png, 
> annots.pdf-6-Zapf.png, checkbox-ok.pdf, converted.png, pdf.png
>
>
> When converting pdf to png (PDPage.convertToImage or ImageWriter.writeImage) 
> checkboxes are wrongly rendered.
> - other interactive components (radiobuttons, ...) look good
> - original pdf was created in Acrobat Pro X (the same behavior with pdf 
> created in other software)



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscr...@pdfbox.apache.org
For additional commands, e-mail: dev-h...@pdfbox.apache.org

Reply via email to