pdf-lite - v1.3.0
    Preparing search index...
    • Encodes a JavaScript string to PDFDocEncoding bytes.

      PDFDocEncoding is the default encoding for PDF strings:

      • Bytes 0-127: Standard ASCII
      • Bytes 128-159: Special Unicode characters (see PDF spec)
      • Bytes 160-255: ISO Latin-1 (ISO 8859-1)

      Parameters

      • str: string

        The string to encode.

      Returns ByteArray

      The encoded byte array.

      // Encode "Hello" (ASCII)
      encodeToPDFDocEncoding('Hello')

      // Encode with special character (bullet → 0x80)
      encodeToPDFDocEncoding('H•i')