| Category | Error handling |
|---|
Purpose — Return the single most-recent error message string.
Description — Returns a pointer to the instance's last-error buffer (FLastErrBuf), or NULL when the buffer is empty (no error recorded, or it was just cleared by pdfClearErrorLog).
Declarations
const char* __stdcall pdfGetErrorMessage(PPDF IPDF);
function pdfGetErrorMessage(const IPDF: PPDF): PAnsiChar; stdcall; external 'LumasPdf.dll';
Return value — Pointer to a NUL-terminated UTF-8/ANSI string, or NULL when there is no current message or the handle is invalid.
Memory & buffers — The pointer is owned by the instance and remains valid until the next error is raised, pdfClearErrorLog is called, or the instance is deleted. Copy it if you need it longer.
Remarks — This is the *last message only*. For the full accumulated history use pdfGetErrLogMessage. Note that pdfClearErrorLog clears this buffer but not the indexed log (see the gotcha at the top of this chapter).
See also — pdfGetErrLogMessage, pdfClearErrorLog
C# (P/Invoke)
public static extern IntPtr pdfGetErrorMessage(IntPtr IPDF);
Getters
pdfGetErrorMessage
The …A form takes UTF-8, …W
takes UTF-16; a bare name aliases the ANSI form.
Worked examples — complete programs in ten languages.