FPDFAnnot_GetFormAdditionalActionJavaScript method

int FPDFAnnot_GetFormAdditionalActionJavaScript(
  1. FPDF_FORMHANDLE hHandle,
  2. FPDF_ANNOTATION annot,
  3. int event,
  4. Pointer<FPDF_WCHAR> buffer,
  5. int buflen,
)

Experimental API. Get the JavaScript of an event of the annotation's additional actions. |buffer| is only modified if |buflen| is large enough to hold the whole JavaScript string. If |buflen| is smaller, the total size of the JavaScript is still returned, but nothing is copied. If there is no JavaScript for |event| in |annot|, an empty string is written to |buf| and 2 is returned, denoting the size of the null terminator in the buffer. On other errors, nothing is written to |buffer| and 0 is returned.

hHandle - handle to the form fill module, returned by FPDFDOC_InitFormFillEnvironment(). annot - handle to an interactive form annotation. event - event type, one of the FPDF_ANNOT_AACTION_* values. buffer - buffer for holding the value string, encoded in UTF-16LE. buflen - length of the buffer in bytes.

Returns the length of the string value in bytes, including the 2-byte null terminator.

Implementation

int FPDFAnnot_GetFormAdditionalActionJavaScript(
  FPDF_FORMHANDLE hHandle,
  FPDF_ANNOTATION annot,
  int event,
  ffi.Pointer<FPDF_WCHAR> buffer,
  int buflen,
) {
  return _FPDFAnnot_GetFormAdditionalActionJavaScript(
    hHandle,
    annot,
    event,
    buffer,
    buflen,
  );
}