Hi,

The string with the U+000A (LF) is retrieved by calling
PDAnnotation.getContents().
I expected to be able to use the String returned by that method in
PDPageContentStream.showText(), but apparently that is not the case.

Thanks.


Johanneke Lamberink

Onior Group B.V.
Jan Pieterszoon Coenstraat  7
2595 WP Den Haag
The Netherlands
Office: +31 70 799 94 85     Mobile: + 31 6 23 76 76 45






Op 27/5/15 12:28 schreef Andreas Lehmkühler <andr...@lehmi.de>:

>Hi,
>
>> Johanneke Lamberink <johanneke.lamber...@onior.com> hat am 27. Mai 2015
>>um
>> 10:52 geschrieben:
>> 
>> 
>> Hi,
>> 
>> When writing a given String to a PDF I am encountering the following
>> stacktraces in the logging:
>> 
>> 
>> Caused by: java.lang.IllegalArgumentException: No glyph for U+000A in
>>font
>> Helvetica
>>         at
>> org.apache.pdfbox.pdmodel.font.PDType1Font.encode(PDType1Font.java:320)
>>         at org.apache.pdfbox.pdmodel.font.PDFont.encode(PDFont.java:282)
>>         at
>> 
>>org.apache.pdfbox.pdmodel.PDPageContentStream.showText(PDPageContentStrea
>>m.java:358)
>> 
>> and:
>> 
>> 
>> 
>> Caused by: java.lang.IllegalArgumentException: This font type only
>>supports
>> 8-bit code points
>>         at
>> org.apache.pdfbox.pdmodel.font.PDType1Font.encode(PDType1Font.java:311)
>>         at org.apache.pdfbox.pdmodel.font.PDFont.encode(PDFont.java:282)
>>         at
>> org.apache.pdfbox.pdmodel.font.PDFont.getStringWidth(PDFont.java:311)
>> 
>> I am not sure if this is a problem in my choice of font, my use of the
>>api, or
>> the encoding done by pdfbox.
>> 
>> Can anyone explain to me what it is that is going wrong here?
>U+000A sounds like line feed. Does your string contain any newline
>characters
>like CR or LF? You have to remove those, as you have to manage line breaks
>yourself.
>
>> Thanks :)
>> 
>> 
>> Johanneke Lamberink
>
>BR
>Andreas Lehmkühler
>
>---------------------------------------------------------------------
>To unsubscribe, e-mail: users-unsubscr...@pdfbox.apache.org
>For additional commands, e-mail: users-h...@pdfbox.apache.org
>


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

Reply via email to