FPDF_GetMetaText method

int FPDF_GetMetaText(
  1. FPDF_DOCUMENT document,
  2. FPDF_BYTESTRING tag,
  3. Pointer<Void> buffer,
  4. int buflen,
)

Get meta-data |tag| content from |document|.

document - handle to the document. tag - the tag to retrieve. The tag can be one of: Title, Author, Subject, Keywords, Creator, Producer, CreationDate, or ModDate. For detailed explanations of these tags and their respective values, please refer to PDF Reference 1.6, section 10.2.1, 'Document Information Dictionary'. buffer - a buffer for the tag. May be NULL. buflen - the length of the buffer, in bytes. May be 0.

Returns the number of bytes in the tag, including trailing zeros.

The |buffer| is always encoded in UTF-16LE. The |buffer| is followed by two bytes of zeros indicating the end of the string. If |buflen| is less than the returned length, or |buffer| is NULL, |buffer| will not be modified.

For linearized files, FPDFAvail_IsFormAvail must be called before this, and it must have returned PDF_FORM_AVAIL or PDF_FORM_NOTEXIST. Before that, there is no guarantee the metadata has been loaded.

Implementation

int FPDF_GetMetaText(
  FPDF_DOCUMENT document,
  FPDF_BYTESTRING tag,
  ffi.Pointer<ffi.Void> buffer,
  int buflen,
) {
  return _FPDF_GetMetaText(document, tag, buffer, buflen);
}