FPDFCatalog_GetLanguage function

  1. @Native<UnsignedLong Function(FPDF_DOCUMENT, Pointer<FPDF_WCHAR>, UnsignedLong)>(FPDF_DOCUMENT, ffi.Pointer<FPDF_WCHAR>, ffi.UnsignedLong)>()
int FPDFCatalog_GetLanguage(
  1. FPDF_DOCUMENT document,
  2. Pointer<FPDF_WCHAR> buffer,
  3. int buflen
)

Experimental API. Gets the language of |document| from the catalog's /Lang entry.

document - handle to a document. buffer - a buffer for the language string. May be NULL. buflen - the length of the buffer, in bytes. May be 0.

Returns the number of bytes in the language string, including the trailing NUL character. The number of bytes is returned regardless of the |buffer| and |buflen| parameters.

Regardless of the platform, the |buffer| is always in UTF-16LE encoding. The string is terminated by a UTF16 NUL character. If |buflen| is less than the required length, or |buffer| is NULL, |buffer| will not be modified.

If |document| has no /Lang entry, an empty string is written to |buffer| and 2 is returned. On error, nothing is written to |buffer| and 0 is returned.

Implementation

@ffi.Native<
  ffi.UnsignedLong Function(
    FPDF_DOCUMENT,
    ffi.Pointer<FPDF_WCHAR>,
    ffi.UnsignedLong,
  )
>()
external int FPDFCatalog_GetLanguage(
  FPDF_DOCUMENT document,
  ffi.Pointer<FPDF_WCHAR> buffer,
  int buflen,
);