PDFBOX : U+000A ('controlLF') is not available in this font Helvetica encoding: WinAnsiEncoding

razvan :

When trying to print a PDF page using Java and the org.apache.pdfbox library, I get this error:

PDFBOX : U+000A ('controlLF') is not available in this font Helvetica encoding: WinAnsiEncoding

razvan :

[PROBLEM] The String you are trying to display contains a newline character.

[SOLUTION] Replace the String with a new one and remove the newline:

text = text.replace("\n", "").replace("\r", "");

Guess you like

Origin http://10.200.1.11:23101/article/api/json?id=458995&siteId=1