pdfPageHasFontResources
Quick check for whether a page selects any font (uses the
| Category | Page introspection |
|---|---|
| Note | a raw substring search, not real content-stream parsing (see Remarks) |
Purpose — Quick check for whether a page selects any font (uses the Tf operator anywhere in its content).
Declarations
int32_t __stdcall pdfPageHasFontResources(PPDF IPDF, int32_t PageNum);
function pdfPageHasFontResources(const IPDF: PPDF; PageNum: Integer): Integer; stdcall; external 'LumasPdf.dll';
Parameters
| Parameter | Type | Description |
|---|---|---|
IPDF | PPDF | Instance handle. |
PageNum | Integer | 1-based page number, output document only — no import-source fallback like pdfExtractText has. |
Return value — 1 if the page's content bytes contain the literal sequence " Tf"; 0 otherwise (including if the page doesn't exist).
Remarks — a string search, not a parse. This checks for the raw byte sequence " Tf" anywhere in the page's content stream — it does not parse operators. In the extremely unlikely case that sequence appears inside a string literal or other non-operator context, this would report a false positive; more practically, it cannot distinguish "selects a font but never draws text" from "actually shows text."
C# (P/Invoke)
public static extern int pdfPageHasFontResources(IntPtr IPDF, int PageNum);
Core
pdfPageHasFontResources
The …A form takes UTF-8, …W
takes UTF-16; a bare name aliases the ANSI form.
Worked examples — complete programs in ten languages.