API referencePrinting

pdfGetPrinterNames

Enumerate installed printers (local + network connections)

C
const char* __stdcall pdfGetPrinterNamesA(PPDF IPDF);
const char* __stdcall pdfGetLatestPrinterNamesA(PPDF IPDF);
const char* __stdcall pdfGetDefaultPrinterNameA(PPDF IPDF);
Delphi
function pdfGetPrinterNamesA(const IPDF: PPDF): PAnsiChar; stdcall;
function pdfGetLatestPrinterNamesA(const IPDF: PPDF): PAnsiChar; stdcall;
function pdfGetDefaultPrinterNameA(const IPDF: PPDF): PAnsiChar; stdcall;

Purpose. Enumerate installed printers (local + network connections) via a real EnumPrinters Win32 call, and report the OS default printer.

Description. Confirmed literal duplicate: pdfGetPrinterNames and pdfGetLatestPrinterNames call the exact same underlying PrnGetPrinterNames — there is no "latest" vs. "all" distinction at this layer despite the different ABI name implying a possibly-cached vs. always-fresh list; both always perform a fresh EnumPrinters call. PrnGetPrinterNames does a genuine two-pass EnumPrinters (size-query, then fill) with PRINTER_ENUM_LOCAL or PRINTER_ENUM_CONNECTIONS, returning a newline-separated name list. PrnGetDefaultPrinter reads the real OS default printer name.

Parameters.

ParameterDescription
IPDFDocument handle (used only for context/buffer ownership; the enumeration itself is a pure OS query).

Return value. A newline-separated printer-name list (transient buffer); empty on a non-Windows build or if no printers are installed. pdfGetDefaultPrinterName: the single default printer's name; empty if none is set.

C# (P/Invoke)

wrappers/dotnet/LumasPdf.cs
public static extern IntPtr pdfGetPrinterNamesW(IntPtr IPDF);
public static extern IntPtr pdfGetPrinterNames(IntPtr IPDF);
public static extern IntPtr pdfGetPrinterNamesA(IntPtr IPDF);
Area
Printing
Category

Getters

Exported names

pdfGetPrinterNamesW pdfGetPrinterNames pdfGetPrinterNamesA

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.