pdfResolveBookmarkDest
Resolve a bookmark's destination page on demand, for
| Exported names | pdfResolveBookmarkDest |
|---|---|
| Calling convention | stdcall |
| Thread safety | One PPDF/handle per thread; see V18 §Threading |
| Introduced | LumasPDF 2.4.2 |
Purpose — Resolve a bookmark's destination page on demand, for bookmarks whose destination was deferred by a lazy import.
Description — With the lazy-content import flag (if2LazyContent) set, an imported bookmark may carry an unresolved destination — its target page is not computed at import time, and pdfGetBookmark reports DestPage as 0 while it is unresolved. This function looks the bookmark up by its handle, resolves the deferred destination against the import source — named destinations and integer-indexed destinations included — caches the result on the bookmark, and returns the destination page number. A bookmark whose destination is already resolved simply returns its cached page, so repeat calls for the same handle are cheap.
Parameters
| Parameter | Type | In/Out | Description |
|---|---|---|---|
IPDF | PPDF | in | Instance handle with an imported document. |
Handle | Integer | in | Bookmark handle as returned by the bookmark enumeration APIs. |
Return value — The 1-based destination page number; 0 when the handle is unknown or the bookmark has no page destination.
Declarations
LPDF_API SI32 PDF_CALL pdfResolveBookmarkDest(PPDF IPDF, SI32 Handle);
function pdfResolveBookmarkDest(const IPDF: PPDF; Handle: Integer): Integer; stdcall; external 'LumasPdf.dll';
C# (P/Invoke)
public static extern int pdfResolveBookmarkDest(IntPtr IPDF, int Handle);
Core
pdfResolveBookmarkDest
The …A form takes UTF-8, …W
takes UTF-16; a bare name aliases the ANSI form.
Worked examples — complete programs in ten languages.