Close

2020-12-04

U+000A (‘controlLF’) is not available in this font encoding: WinAnsiEncoding.

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

For my last project,  I am using Java and Apache PDFBOX .   For the chaotic “U+000A (‘controlLF’) is not available in this font  encoding: WinAnsiEncoding.”  Error I ‘ve found a simple solution

/**
*
*U+000A ('controlLF') is not available in this font encoding: WinAnsiEncoding.
*Java, Apache PDFBox
* www.ozgurozkok.com
*/
public class FixEncoding extends WinAnsiEncoding {
public String remove(String bufstr) {
StringBuilder b = new StringBuilder();
for (int i = 0; i < bufstr.length(); i++) {
if (WinAnsiEncoding.INSTANCE.contains(bufstr.charAt(i))) {
b.append(bufstr.charAt(i));
}
}
return b.toString();
}}
view raw gistfile1.txt hosted with ❤ by GitHub