pdfbox-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Hartmann Toël <Toel.Hartm...@elanders.com>
Subject Re: About the WinAnsiEncoding error
Date Fri, 27 Apr 2018 08:46:00 GMT
Hi,

It seems Acrobat is only embedding the glyph used in your text as a subset, the complete font
is not included.

Could that be the problem?

/Toël



[cid:image001.png@01CF299E.7E3B49A0]


 m3 developer
 Elanders Sverige AB
 Phone Switchboard: +46 31 750 00 00
 Phone direct: +46 31 750 08 86
 E-mail: toel.hartmann@elanders.com<mailto:toel.hartmann@elanders.com>
 Homepage: www.elanders.se<http://www.elanders.se>

On 27 apr 2018, at 10:39, Mickael Marrache <mickaelmarrache@gmail.com<mailto:mickaelmarrache@gmail.com>>
wrote:

Hi,

I created a blank PDF with Acrobat Pro DC. I added one text field with font
David. I filled the text field using Acrobat so that it displays the David
font in the fonts section (in Document Properties window). Then, I applied
fixup "Embed missing fonts" via the Preflight menu.

When I look at the fonts list (in Document Properties), I can see the David
font with the following properties:

David (Embedded Subset)
Type: TrueType (CID)
Encoding: Identity-H

When I try to set a value containing Hebrew characters using PDF box, I get
the following error:

java.lang.IllegalArgumentException: U+05D0 is not available in this font's
encoding: WinAnsiEncoding
at
org.apache.pdfbox.pdmodel.font.PDTrueTypeFont.encode(PDTrueTypeFont.java:399)
at org.apache.pdfbox.pdmodel.font.PDFont.encode(PDFont.java:323)
at org.apache.pdfbox.pdmodel.font.PDFont.getStringWidth(PDFont.java:352)

I already know the workaround of embedding a font before setting the value
but I'm trying to understand what is going on here. I understand the Hebrew
characters are not in the WinAnsiEncoding but why this encoding is used at
the first place?

Thanks,
Mickael


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