pdfbox-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Bharat Bhatt <bharatbh...@gmail.com>
Subject Text width calculation
Date Wed, 14 Jun 2017 04:37:00 GMT

I am using PDFBOX 2.0.4 api, and using  PDType1Font.HELVETICA font.
So when calculating text width using

        String text = "Tipo Identificación";
        PDFont pdFont = PDType1Font.HELVETICA;
        float width = (pdFont.getStringWidth(text) / 1000F)* 12f;

Getting error
Caused by: java.lang.IllegalArgumentException: U+FFFD ('.notdef') is not
available in this font Helvetica (generic: ArialMT) encoding:

But same code work on Linux server.

How to resolve this and make system independent?

How to support other languages?


  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message