Class PDFDocCharsetEncoder

java.lang.Object
java.nio.charset.CharsetEncoder
org.loboevolution.pdfview.PDFDocCharsetEncoder

public class PDFDocCharsetEncoder extends CharsetEncoder
Encodes into a PDFDocEncoding representation. Note that only 256 characters (if that) are represented in the PDFDocEncoding, so users should be prepared to deal with unmappable character exceptions.

see "PDF Reference version 1.7, Appendix D" Author Luke Kirby

  • Constructor Details

    • PDFDocCharsetEncoder

      public PDFDocCharsetEncoder()

      Constructor for PDFDocCharsetEncoder.

  • Method Details

    • isIdentityEncoding

      public static boolean isIdentityEncoding(char ch)
      Identify whether a particular character preserves the same byte value upon encoding in PDFDocEncoding
      Parameters:
      ch - the character
      Returns:
      whether the character is identity encoded
    • encodeLoop

      protected CoderResult encodeLoop(CharBuffer in, ByteBuffer out)
      Specified by:
      encodeLoop in class CharsetEncoder
    • isLegalReplacement

      public boolean isLegalReplacement(byte[] repl)
      Overrides:
      isLegalReplacement in class CharsetEncoder