pdfSelectedDocument
LumasPDF-multi-document-session ABI compatibility shims — this
int32_t __stdcall pdfDocumentCount(PPDF IPDF);
int32_t __stdcall pdfSelectDocument(PPDF IPDF, int32_t DocumentID);
int32_t __stdcall pdfSelectedDocument(PPDF IPDF);
function pdfDocumentCount(const IPDF: PPDF): Integer; stdcall;
function pdfSelectDocument(const IPDF: PPDF; DocumentID: Integer): Integer; stdcall;
function pdfSelectedDocument(const IPDF: PPDF): Integer; stdcall;
Purpose. LumasPDF-multi-document-session ABI compatibility shims — this engine has no multi-document-per-handle concept at all; each PPDF handle is always exactly one document.
Description. pdfDocumentCount always returns 1 for a valid handle (0 for an invalid one) — explicitly commented "single-doc model" in source. pdfSelectDocument only succeeds (1) when DocumentID = 1 (the only "document" that could ever exist); any other DocumentID fails. pdfSelectedDocument always returns 1 for a valid handle. None of these three actually select or switch between documents — they exist so that convention-ported code calling this trio in the conventional Count→Select(1)→... pattern continues to work unchanged against this engine's single-document reality.
Parameters.
| Parameter | Description |
|---|---|
IPDF | Document handle. |
DocumentID | *(SelectDocument only)* Must be 1 — any other value fails. |
Return value. pdfDocumentCount: 1 if IPDF valid, else 0. pdfSelectDocument: 1 if IPDF valid and DocumentID = 1, else 0. pdfSelectedDocument: 1 if IPDF valid, else 0.
C# (P/Invoke)
public static extern int pdfSelectedDocument(IntPtr IPDF);
Core
pdfSelectedDocument
The …A form takes UTF-8, …W
takes UTF-16; a bare name aliases the ANSI form.
Worked examples — complete programs in ten languages.