FPDFAttachment_SetFile function

  1. @Native<FPDF_BOOL Function(FPDF_ATTACHMENT, FPDF_DOCUMENT, Pointer<Void>, UnsignedLong)>(FPDF_ATTACHMENT, FPDF_DOCUMENT, ffi.Pointer<ffi.Void>, ffi.UnsignedLong)>()
int FPDFAttachment_SetFile(
  1. FPDF_ATTACHMENT attachment,
  2. FPDF_DOCUMENT document,
  3. Pointer<Void> contents,
  4. int len,
)

Experimental API. Set the file data of |attachment|, overwriting the existing file data if any. The creation date and checksum will be updated, while all other dictionary entries will be deleted. Note that only contents with |len| smaller than INT_MAX is supported.

attachment - handle to an attachment. contents - buffer holding the file data to write to |attachment|. len - length of file data in bytes.

Returns true if successful.

Implementation

@ffi.Native<
  FPDF_BOOL Function(
    FPDF_ATTACHMENT,
    FPDF_DOCUMENT,
    ffi.Pointer<ffi.Void>,
    ffi.UnsignedLong,
  )
>()
external int FPDFAttachment_SetFile(
  FPDF_ATTACHMENT attachment,
  FPDF_DOCUMENT document,
  ffi.Pointer<ffi.Void> contents,
  int len,
);