API referenceFonts

pdfAddFontSearchPath

Register a directory to search for .pfb Type 1 fonts when

CategoryFont policy (narrow, real use)
Notenarrowly scoped to PDF/A symbolic-font embedding, Recursive unused (see Remarks)

Purpose — Register a directory to search for .pfb Type 1 fonts when embedding the symbolic standard fonts (Symbol/ZapfDingbats) is required for PDF/A conformance.

Description — narrower than the name suggests. This is not a general-purpose search path consulted by pdfSetFont's resolution chain. It is consulted at serialization time only when the document targets a PDF/A conformance level (pdfSetPDFAConformance or similar) and one of the document's fonts resolved to the symbolic Symbol or ZapfDingbats standard font — those two have no standard Windows TrueType equivalent, so PDF/A's "fully embedded" requirement needs a .pfb file (Symbol.pfb/StandardSymL.pfb/s050000l.pfb, or the ZapfDingbats equivalents) found in one of: the paths registered here, the module's own directory, or the module directory's fonts\ subfolder.

Declarations

C
int32_t __stdcall pdfAddFontSearchPathA(PPDF IPDF, const char* APath, BOOL32 Recursive);
int32_t __stdcall pdfAddFontSearchPathW(PPDF IPDF, const wchar_t* APath, BOOL32 Recursive);
Delphi
function pdfAddFontSearchPathA(const IPDF: PPDF; const APath: PAnsiChar; Recursive: LongBool): Integer; stdcall; external 'LumasPdf.dll';
function pdfAddFontSearchPathW(const IPDF: PPDF; const APath: PWideChar; Recursive: LongBool): Integer; stdcall; external 'LumasPdf.dll';

Parameters

ParameterTypeDescription
IPDFPPDFInstance handle.
APathstringDirectory to add to the PDF/A symbolic-font search list.
RecursiveBOOL32Accepted but not read — only the directory itself is searched, not subdirectories, regardless of this flag.

Return value — 1-based count of registered search paths (also usable as a de facto "handle," though nothing currently removes a single path — see Remarks).

Remarks — If you only need standard-14 or system-installed fonts, you will never observe this call doing anything — it only matters for the narrow PDF/A + Symbol/ZapfDingbats combination. There is no corresponding "remove path" call in this cluster.

C# (P/Invoke)

wrappers/dotnet/LumasPdf.cs
public static extern int pdfAddFontSearchPathA(IntPtr IPDF, [MarshalAs(UnmanagedType.LPStr)] string APath, [MarshalAs(UnmanagedType.Bool)] bool Recursive);
public static extern int pdfAddFontSearchPathW(IntPtr IPDF, [MarshalAs(UnmanagedType.LPWStr)] string APath, [MarshalAs(UnmanagedType.Bool)] bool Recursive);
Area
Fonts
Category

Content Creation

Exported names

pdfAddFontSearchPathA pdfAddFontSearchPathW

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.