| Category | Error handling |
|---|---|
| Variants | pdfSetErrorMode (bare) |
| Thread safety | Per-document handle; set before multi-threaded use. |
Purpose — Choose which error classes are logged and delivered to the callback.
Description — Stores an em* bitmask on the instance (FErrorMode). RaiseError consults it on every error: mode 0 (emIgnoreAll) returns immediately — no log entry, no callback. For a non-zero mode the error's type is mapped to one class bit and that bit is tested; a masked-off class is skipped for both the log and the callback. The class bits are emSyntaxError=$01, emValueError=$02, emWarning=$04, emFileError=$08, emFontError=$10; emAllErrors=$0000FFFF enables every class (the default).
Declarations
BOOL32 __stdcall pdfSetErrorMode(PPDF IPDF, int32_t ErrMode);
function pdfSetErrorMode(const IPDF: PPDF; ErrMode: Integer): LongBool; stdcall; external 'LumasPdf.dll';
Parameters
| Parameter | Type | Description |
|---|---|---|
IPDF | PPDF | Instance handle. |
ErrMode | int32_t | em* bitmask (see Lumas.Pdf.Consts). |
Return value — TRUE on a valid handle; FALSE if the handle is invalid.
Remarks — The high-bit modifiers emNoFuncNames ($10000000) and emUseErrLog ($20000000) are accepted for ABI compatibility but are legacy no-ops in this engine — the indexed log is always available regardless. Set the mode once, right after pdfNewPDF, before doing work you want captured.
See also — pdfGetErrorMode, pdfSetOnErrorProc, pdfGetErrLogMessage
C# (P/Invoke)
[return: MarshalAs(UnmanagedType.Bool)]
Setters
pdfSetErrorMode
The …A form takes UTF-8, …W
takes UTF-16; a bare name aliases the ANSI form.
Worked examples — complete programs in ten languages.