API referenceCore SDK

pdfGetErrorMessage

Return the single most-recent error message string.

CategoryError 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

C
const char* __stdcall pdfGetErrorMessage(PPDF IPDF);
Delphi
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 alsopdfGetErrLogMessage, pdfClearErrorLog

C# (P/Invoke)

wrappers/dotnet/LumasPdf.cs
public static extern IntPtr pdfGetErrorMessage(IntPtr IPDF);
Area
Core SDK
Category

Getters

Exported names

pdfGetErrorMessage

String variants

The …A form takes UTF-8, …W takes UTF-16; a bare name aliases the ANSI form.

See working code

Worked examples — complete programs in ten languages.