It works for me. Please read this:
https://pdfbox.apache.org/3.0/faq.html#what-fonts-do-i-need-on-my-system%3F

and install ZapfDingbats or another appropriate font as mentioned there.

Btw your code is for PDFBox 2.0, but you mention 3.0.7.

Tilman


On 2026/06/12 08:52:01 杨喆 wrote:
> Dear PDFBox developers,
> 
> Please find below a bug report regarding PDF to PNG conversion.
> Describe the bug
> 
> 
> When converting a PDF document to PNG images, checkboxes are displayed as 
> empty squares (□) and the checkmarks inside checked checkboxes are not shown. 
> The original PDF contains properly rendered checkmarks (e.g., ☑) or filled 
> checkboxes, but after conversion, they all appear as empty squares.
> 
> 
> 
> 
> Sample Code
> 
> 
> PDDocument document = PDDocument.load(new File("sample.pdf")); PDFRenderer 
> renderer = new PDFRenderer(document); BufferedImage image = 
> renderer.renderImage(0, 2.0f); ImageIO.write(image, "PNG", new 
> File("output.png"));
> 
> 
> Expected behavior
> 
> 
> Checked checkboxes should be rendered as filled squares or squares containing 
> a checkmark (e.g., ☑). Unchecked checkboxes may remain as empty squares (□). 
> The visual state should match what is seen when opening the PDF in Adobe 
> Acrobat or a standard PDF viewer.
> 
> 
> - OS: window10
> -  version:3.0.7
> 
> 
> 
> Attached files:
> 
> 
> Problem document (copy.pdf)
> 
> 
> 
> Screenshots (copy.png)
> 
> 
> 
> 
> 
> 杨喆
> [email protected]

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

Reply via email to