FPDFAction_GetURIPath function

  1. @Native<UnsignedLong Function(FPDF_DOCUMENT, FPDF_ACTION, Pointer<Void>, UnsignedLong)>(FPDF_DOCUMENT, FPDF_ACTION, ffi.Pointer<ffi.Void>, ffi.UnsignedLong)>()
int FPDFAction_GetURIPath(
  1. FPDF_DOCUMENT document,
  2. FPDF_ACTION action,
  3. Pointer<Void> buffer,
  4. int buflen,
)

Get the URI path of |action|.

document - handle to the document. action - handle to the action. Must be a |PDFACTION_URI|. buffer - a buffer for the path string. May be NULL. buflen - the length of the buffer, in bytes. May be 0.

Returns the number of bytes in the URI path, including the trailing NUL character, or 0 on error, typically because the arguments were bad or the action was of the wrong type.

The |buffer| may contain badly encoded data. The caller should validate the output. e.g. Check to see if it is UTF-8.

If |buflen| is less than the returned length, or |buffer| is NULL, |buffer| will not be modified.

Historically, the documentation for this API claimed |buffer| is always encoded in 7-bit ASCII, but did not actually enforce it. https://pdfium.googlesource.com/pdfium.git/+/d609e84cee2e14a18333247485af91df48a40592 added that enforcement, but that did not work well for real world PDFs that used UTF-8. As of this writing, this API reverted back to its original behavior prior to commit d609e84cee.

Implementation

@ffi.Native<
  ffi.UnsignedLong Function(
    FPDF_DOCUMENT,
    FPDF_ACTION,
    ffi.Pointer<ffi.Void>,
    ffi.UnsignedLong,
  )
>()
external int FPDFAction_GetURIPath(
  FPDF_DOCUMENT document,
  FPDF_ACTION action,
  ffi.Pointer<ffi.Void> buffer,
  int buflen,
);