开发者

Measuring text width with font as org.faceless.pdf.PDFFont instance

开发者 https://www.devze.com 2022-12-24 07:55 出处:网络
I have text 开发者_如何学编程with font in org.faceless.pdf.PDFFont. How can I get width of it in px?

I have text 开发者_如何学编程with font in org.faceless.pdf.PDFFont. How can I get width of it in px?

Thanks.


If you mean how to get the width in points (pixels don't really apply in PDF) then you can create a PDFStyle with that font and call PDFStyle.getTextLength() or PDFStyle.getTextWidths().

In general, if you have support questions for the BFO PDF Library please drop us an email at support at bfo.co.uk - that's what we're there for. All our contact details are at http://bfo.co.uk/contact.jsp.

Cheers... Mike @ BFO

0

精彩评论

暂无评论...
验证码 换一张
取 消