FPDFAttachment_GetStringValue function

  1. @Native<UnsignedLong Function(FPDF_ATTACHMENT, FPDF_BYTESTRING, Pointer<FPDF_WCHAR>, UnsignedLong)>(FPDF_ATTACHMENT, FPDF_BYTESTRING, ffi.Pointer<FPDF_WCHAR>, ffi.UnsignedLong)>()
int FPDFAttachment_GetStringValue(
  1. FPDF_ATTACHMENT attachment,
  2. FPDF_BYTESTRING key,
  3. Pointer<FPDF_WCHAR> buffer,
  4. int buflen,
)

Experimental API. Get the string value corresponding to |key| in the params dictionary of the embedded file |attachment|. |buffer| is only modified if |buflen| is longer than the length of the string value. Note that if |key| does not exist in the dictionary or if |key|'s corresponding value in the dictionary is not a string (i.e. the value is not of type FPDF_OBJECT_STRING or FPDF_OBJECT_NAME), then an empty string would be copied to |buffer| and the return value would be 2. On other errors, nothing would be added to |buffer| and the return value would be 0.

attachment - handle to an attachment. key - the key to the requested string value, encoded in UTF-8. buffer - buffer for holding the string value encoded in UTF-16LE. buflen - length of the buffer in bytes.

Returns the length of the dictionary value string in bytes.

Implementation

@ffi.Native<
  ffi.UnsignedLong Function(
    FPDF_ATTACHMENT,
    FPDF_BYTESTRING,
    ffi.Pointer<FPDF_WCHAR>,
    ffi.UnsignedLong,
  )
>()
external int FPDFAttachment_GetStringValue(
  FPDF_ATTACHMENT attachment,
  FPDF_BYTESTRING key,
  ffi.Pointer<FPDF_WCHAR> buffer,
  int buflen,
);