PDFBOX : U+000A ('controlLF') is not available in this font Helvetica encoding: WinAnsiEncoding
问题 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 回答1: [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", ""); 回答2: The answer selected for this post works, replacing all instances of \n and \r from your string, if