FPDFAttachment_GetFile function

  1. @Native<FPDF_BOOL Function(FPDF_ATTACHMENT, Pointer<Void>, UnsignedLong, Pointer<UnsignedLong>)>(FPDF_ATTACHMENT, ffi.Pointer<ffi.Void>, ffi.UnsignedLong, ffi.Pointer<ffi.UnsignedLong>)>()
int FPDFAttachment_GetFile(
  1. FPDF_ATTACHMENT attachment,
  2. Pointer<Void> buffer,
  3. int buflen,
  4. Pointer<UnsignedLong> out_buflen,
)

Experimental API. Get the file data of |attachment|. When the attachment file data is readable, true is returned, and |out_buflen| is updated to indicate the file data size. |buffer| is only modified if |buflen| is non-null and long enough to contain the entire file data. Callers must check both the return value and the input |buflen| is no less than the returned |out_buflen| before using the data.

Otherwise, when the attachment file data is unreadable or when |out_buflen| is null, false is returned and |buffer| and |out_buflen| remain unmodified.

attachment - handle to an attachment. buffer - buffer for holding the file data from |attachment|. buflen - length of the buffer in bytes. out_buflen - pointer to the variable that will receive the minimum buffer size to contain the file data of |attachment|.

Returns true on success, false otherwise.

Implementation

@ffi.Native<
  FPDF_BOOL Function(
    FPDF_ATTACHMENT,
    ffi.Pointer<ffi.Void>,
    ffi.UnsignedLong,
    ffi.Pointer<ffi.UnsignedLong>,
  )
>()
external int FPDFAttachment_GetFile(
  FPDF_ATTACHMENT attachment,
  ffi.Pointer<ffi.Void> buffer,
  int buflen,
  ffi.Pointer<ffi.UnsignedLong> out_buflen,
);