pdf-lite - v1.3.0
    Preparing search index...

    Function encodeAsUTF16BE

    • Encodes a string as UTF-16BE with BOM for PDF

      PDF strings can use UTF-16BE encoding to represent Unicode characters. The encoding must start with the UTF-16BE BOM (0xFE 0xFF) to be recognized.

      Parameters

      • str: string

        The string to encode

      Returns ByteArray

      Byte array with UTF-16BE BOM followed by the encoded string

      encodeAsUTF16BE('PROSZĘ')
      // Returns Uint8Array([0xFE, 0xFF, 0x00, 0x50, 0x00, 0x52, ...])