Tilman,

Thanks for your feedback. For this example I'm using 2.0. It does not work with 
1.8. Is the ' LiberationSans-Regular file from the source code download' 
different from the one I downloaded it from 
(http://www.dafont.com/liberation-sans.font)? The code broke on the following 
line:
        stream.showText("English русский язык Tiếng Việt");

Other than that I do not know on what character brought the error. But some 
searching on the internet brought me 
(https://en.wikipedia.org/wiki/Unicode_equivalence) " the character U+1EBF (ế), 
used in Vietnamese, has both an acute and a circumflex accent", the e in Tiếng. 

Michel

-----Original Message-----
From: Tilman Hausherr [mailto:[email protected]] 
Sent: vrijdag 6 mei 2016 16:40
To: [email protected]
Subject: Re: unmappable character for encoding Cp1252

What PDFBox version are you using? Hopefully 2.0

Which line and which character brings this error?

Try also using the  LiberationSans-Regular file from the source code download.

Tilman

Am 06.05.2016 um 16:35 schrieb Macamba:
> Ah, now I see it. Do not use the download link as in "Links to HEAD:  (view) 
> (download) (annotate)". You'll get gibberish, but if you use the view you'll 
> get the "English русский язык Tiếng Việt" text.
>
> My venerable VI clone on Windows cannot work with that text.
>
> If I run the right code in Eclipse, however, I get:
> Exception in thread "main" java.lang.IllegalArgumentException: No glyph for 
> U+1EBF in font LiberationSans-Regular
>       at 
> org.apache.pdfbox.pdmodel.font.PDCIDFontType2.encode(PDCIDFontType2.java:411)
>       at 
> org.apache.pdfbox.pdmodel.font.PDType0Font.encode(PDType0Font.java:351)
>       at org.apache.pdfbox.pdmodel.font.PDFont.encode(PDFont.java:286)
>       at 
> org.apache.pdfbox.pdmodel.PDPageContentStream.showText(PDPageContentStream.java:411)
>       at 
> org.apache.pdfbox.examples.pdmodel.EmbeddedFonts.main(EmbeddedFonts.ja
> va:53)
>
> Thanks for the input.         
>
> -----Original Message-----
> From: Tilman Hausherr [mailto:[email protected]]
> Sent: vrijdag 6 mei 2016 14:26
> To: [email protected]
> Subject: Re: unmappable character for encoding Cp1252
>
> Am 06.05.2016 um 14:21 schrieb Macamba:
>> Hi all,
>>
>>    
>>
>> Is it me or is the EmbeddedFonts example in the pdmodel directory of the 
>> pdfbox examples on SVN Apache not working?
>>
>>    
>>
>> I get The following output:
>>
>> src\org\apache\pdfbox\examples\pdmodel\EmbeddedFonts.java:63: error: 
>> unmappable character for encoding Cp1252
>>
>>           stream.showText("English ÐÇÐâÐ?Ð?ð║ð©ð╣ Ð?ðÀÐïð║ Tiß║┐ng 
>> Việt");
>>
>>                                         ^
>>
>> src\org\apache\pdfbox\examples\pdmodel\EmbeddedFonts.java:63: error: 
>> unmappable character for encoding Cp1252
>>
>>           stream.showText("English ÐÇÐâÐ?Ð?ð║ð©ð╣ Ð?ðÀÐïð║ Tiß║┐ng 
>> Việt");
>>
>>                                           ^
>>
>> src\org\apache\pdfbox\examples\pdmodel\EmbeddedFonts.java:63: error: 
>> unmappable character for encoding Cp1252
>>
>>           stream.showText("English ÐÇÐâÐ?Ð?ð║ð©ð╣ Ð?ðÀÐïð║ Tiß║┐ng 
>> Việt");
>>
>>                                                    ^
>>
>> 3 errors
>>
>> Error: Could not find or load main class 
>> src.org.apche.pdfbox.examples.pdmodel.EmbeddedFonts
>>
>>    
>>
>> Location: 
>> https://svn.apache.org/viewvc/pdfbox/trunk/examples/src/main/java/org
>> /apache/pdfbox/examples/pdmodel/EmbeddedFonts.java?view=log
>>
>>    
>>
>> Line 63 in the code reads:
>>
>>           stream.showText("English русский язык Tiếng 
>> Việt");
>>
>>    
>>
>> Should that not be human readable text?
> Yes... it is human readable text with this link:
>
> https://svn.apache.org/viewvc/pdfbox/trunk/examples/src/main/java/org/
> apache/pdfbox/examples/pdmodel/EmbeddedFonts.java?view=markup
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [email protected]
> For additional commands, e-mail: [email protected]
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [email protected]
> For additional commands, e-mail: [email protected]
>


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to