pdfbox-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From John Hewson <j...@jahewson.com>
Subject Re: PDFBox 2.0.0-RC1 and mixed latin-japanese fonts
Date Fri, 30 Oct 2015 18:57:45 GMT

> On 30 Oct 2015, at 06:08, Paolo Contessi <paolo.contessi@gmail.com> wrote:
> 
> Hello everybody,
> 	I’m trying to produce a PDF/A-1b which contains both japanese and latin characters
but I get the following error:
> 
> java.lang.IllegalArgumentException: No glyph for U+0082 in font BitstreamVeraSans-Roman
> 	at org.apache.pdfbox.pdmodel.font.PDCIDFontType2.encode(PDCIDFontType2.java:382)
> 	at org.apache.pdfbox.pdmodel.font.PDType0Font.encode(PDType0Font.java:338)
> 	at org.apache.pdfbox.pdmodel.font.PDFont.encode(PDFont.java:282)
> 	at org.apache.pdfbox.pdmodel.font.PDFont.getStringWidth(PDFont.java:311)
> 	... 31 more
> 
> The same problem occurs if I try to run the example at https://svn.apache.org/viewvc/pdfbox/trunk/examples/src/main/java/org/apache/pdfbox/examples/pdmodel/EmbeddedFonts.java?revision=1703059&view=co
<https://svn.apache.org/viewvc/pdfbox/trunk/examples/src/main/java/org/apache/pdfbox/examples/pdmodel/EmbeddedFonts.java?revision=1703059&view=co>
> 
> Exception in thread "main" java.lang.IllegalArgumentException: No glyph for U+0081 in
font LiberationSans
> 	at org.apache.pdfbox.pdmodel.font.PDCIDFontType2.encode(PDCIDFontType2.java:382)
> 	at org.apache.pdfbox.pdmodel.font.PDType0Font.encode(PDType0Font.java:338)
> 	at org.apache.pdfbox.pdmodel.font.PDFont.encode(PDFont.java:282)
> 	at org.apache.pdfbox.pdmodel.PDPageContentStream.showText(PDPageContentStream.java:341)
> 	at biz.videomed.tvm.hubapps.checklist.model.EmbeddedFonts.main(EmbeddedFonts.java:64)
> 
> 
> If I’m right the problem is that the font is not able to render that character, what
font can I use or how can I solve this issue?
> 

U+0082 is the "BREAK PERMITTED HERE” character, which doesn’t correspond to any glyph,
so PDFBox can’t typeset it. You need to strip out the Unicode control characters from any
text you have before using it with PDFBox.

— John

> I’m working on both Mac OS X El Captain and Ubuntu 12.04-32bit, Java 7.
> 
> Paolo Contessi
> (Software engineer)
> 
> 
> 


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


Mime
View raw message