pdfConvertEMFSpool
Convert a Windows print-spool EMF file to a new PDF page,
int32_t __stdcall pdfConvertEMFSpoolA(PPDF IPDF, const char* SpoolFile, double LeftMargin, double TopMargin, int32_t Flags);
int32_t __stdcall pdfConvertEMFSpoolW(PPDF IPDF, const wchar_t* SpoolFile, double LeftMargin, double TopMargin, int32_t Flags);
function pdfConvertEMFSpoolA(const IPDF: PPDF; const SpoolFile: PAnsiChar; LeftMargin, TopMargin: Double; Flags: Integer): Integer; stdcall;
function pdfConvertEMFSpoolW(const IPDF: PPDF; const SpoolFile: PWideChar; LeftMargin, TopMargin: Double; Flags: Integer): Integer; stdcall;
Purpose. Convert a Windows print-spool EMF file to a new PDF page, replaying it as real vector content (treats the whole spool as a single EMF and replays it, sized to the metafile's own bounds plus margins).
Description. Flags is accepted by both but never passed through to pdfConvertEMFSpool_Impl — no flag-driven behavior (e.g. selective page ranges within a multi-page spool, or scaling mode) is reachable regardless of value. Unlike pdfInsertMetafile (Metafile Insertion (EMF/WMF)), this always creates a new page sized to the metafile bounds plus margins, rather than replaying onto an existing page at a caller-specified box.
Parameters.
| Parameter | Description |
|---|---|
IPDF | Document handle. |
SpoolFile | Path to the EMF spool file. |
LeftMargin, TopMargin | Page margins added around the metafile's own bounds. |
Flags | Accepted but silently dropped. |
Return value. 1 on success; 0 if the file doesn't exist, isn't a valid EMF, or IPDF is invalid.
See also. pdfInsertMetafile (replays onto an existing page instead of creating one).
C# (P/Invoke)
public static extern int pdfConvertEMFSpoolA(IntPtr IPDF, [MarshalAs(UnmanagedType.LPStr)] string SpoolFile, double LeftMargin, double TopMargin, int Flags);
public static extern int pdfConvertEMFSpoolW(IntPtr IPDF, [MarshalAs(UnmanagedType.LPWStr)] string SpoolFile, double LeftMargin, double TopMargin, int Flags);
Conversion
pdfConvertEMFSpoolA
pdfConvertEMFSpoolW
The …A form takes UTF-8, …W
takes UTF-16; a bare name aliases the ANSI form.
Worked examples — complete programs in ten languages.