On 11.02.2025 11:23, Stefan wrote:
Call PDFont.getStringWidth()
with this approach I get an exception:
java.lang.IllegalArgumentException: U+0031 ('one') is not available in font 
AAAAAE+MinionPro-Regular

But the document itself renders correctly, the character with the missing font 
information is displayed nicely, even following characters are positioned 
properly

Any other way to get the width?


You shouldn't reuse subsetted fonts from existing PDFs. Use a "fresh" font if you want to add something on top of a PDF. And don't try to "edit" existing PDFs, i.e. replace texts, this is extremely difficult.

https://pdfbox.apache.org/2.0/migration.html#why-was-the-replacetext-example-removed%3F

Tilman


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

Reply via email to