Skip to content

Instantly share code, notes, and snippets.

@ozgurozkok
Created December 4, 2020 18:27
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ozgurozkok/9a2b43f2d0533de6ad614c31e82ce37b to your computer and use it in GitHub Desktop.
Save ozgurozkok/9a2b43f2d0533de6ad614c31e82ce37b to your computer and use it in GitHub Desktop.
/**
*
*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();
}}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment