API referenceFonts

pdfPageHasFontResources

Quick check for whether a page selects any font (uses the

CategoryPage introspection
Notea 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

C
int32_t __stdcall pdfPageHasFontResources(PPDF IPDF, int32_t PageNum);
Delphi
function pdfPageHasFontResources(const IPDF: PPDF; PageNum: Integer): Integer; stdcall; external 'LumasPdf.dll';

Parameters

ParameterTypeDescription
IPDFPPDFInstance handle.
PageNumInteger1-based page number, output document only — no import-source fallback like pdfExtractText has.

Return value1 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)

wrappers/dotnet/LumasPdf.cs
public static extern int pdfPageHasFontResources(IntPtr IPDF, int PageNum);
Area
Fonts
Category

Core

Exported names

pdfPageHasFontResources

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.