pdfCheckAndRepairFonts
Validate every registered font entry and repair anything
| Category | Font validation |
|---|
Purpose — Validate every registered font entry and repair anything broken, in place.
Description — For each font entry: an empty /BaseFont name is repaired to "Helvetica"; a TrueType entry whose backing font data is missing/marked invalid is demoted to a non-embedded standard-font reference (so the document remains valid even if the underlying font data was somehow lost); a dangling Type 1 index is cleared. Standard-14 entries are always considered valid as-is.
Declarations
int32_t __stdcall pdfCheckAndRepairFonts(PPDF IPDF);
function pdfCheckAndRepairFonts(const IPDF: PPDF): Integer; stdcall; external 'LumasPdf.dll';
Return value — Number of font entries that are valid after the repair pass runs (in practice, this is always equal to the total font count, since every category of problem this function checks for is actively repaired rather than left failing).
C# (P/Invoke)
public static extern int pdfCheckAndRepairFonts(IntPtr IPDF);
Validation
pdfCheckAndRepairFonts
The …A form takes UTF-8, …W
takes UTF-16; a bare name aliases the ANSI form.
Worked examples — complete programs in ten languages.