pdfbox-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Martin Minka <martin.mi...@gmail.com>
Subject Re: How to write UTF-8 text into PDF?
Date Wed, 18 Dec 2013 16:11:28 GMT
Hello Tan,
my answer will not make you happy. I asked similar question (
http://markmail.org/message/l6au7uo4ytt6zzlf) and got answer that UTF-8
support will be added with
https://issues.apache.org/jira/browse/PDFBOX-922. Vote on that issue
if you want to have it solved.

I ended up to use PdfClown library where it was easy to add UTF-8 text with
embedding TTF font into PDF document. The only problem I found with
PdfClown is that it doesn't support font subsetting and the resulting PDF
gets very big by embedding the whole TTF font. See my feature request

The PDFBOX-922 ticket is the second most voted so hopefully it will be


2013/12/18 Tan YuQiang <tanyuqiang@gmail.com>

> I can write free text annotation with UTF-8 string  successfully, but when
> i use  PDPageContentStream  to draw UTF-8 string,  it is not written
> correctly.  why?
> My code is like below:
>         PDFont font = PDType1Font.TIMES_ROMAN;
>         contentStream.setFont(font, fontSize ); //PDPageContentStream
>          contentStream.moveTextPositionByAmount(x, y);
>          contentStream.drawString(info.getText());
> Thank you for any hint,
> Devin Tan

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