API referenceCore SDK

pdfInsertSVG

Parse and draw an SVG document onto the current page as real

C
BOOL32 __stdcall pdfInsertSVGA(PPDF IPDF, const char* FileName, double PosX, double PosY, double Width, double Height, int32_t Flags);
BOOL32 __stdcall pdfInsertSVGW(PPDF IPDF, const wchar_t* FileName, double PosX, double PosY, double Width, double Height, int32_t Flags);
BOOL32 __stdcall pdfInsertSVGEx(PPDF IPDF, void* Buffer, uint32_t BufSize, double PosX, double PosY, double Width, double Height, int32_t Flags);
Delphi
function pdfInsertSVGA(const IPDF: PPDF; const FileName: PAnsiChar; PosX, PosY, Width, Height: Double; Flags: Integer): LongBool; stdcall;
function pdfInsertSVGW(const IPDF: PPDF; const FileName: PWideChar; PosX, PosY, Width, Height: Double; Flags: Integer): LongBool; stdcall;
function pdfInsertSVGEx(const IPDF: PPDF; Buffer: Pointer; BufSize: Cardinal; PosX, PosY, Width, Height: Double; Flags: Integer): LongBool; stdcall;

Purpose. Parse and draw an SVG document onto the current page as real PDF vector content — from a file (A/W) or an in-memory buffer (Ex).

Description. Flags is accepted by all three but never passed through to DrawSVG — same dropped-parameter pattern as pdfConvertEMFSpool above. All three ultimately call the identical DrawSVG with the raw SVG markup bytes; this chapter did not independently re-verify DrawSVG's own supported-SVG-feature subset (consult the engine DrawSVG directly for exact tag/attribute coverage before relying on complex SVG content rendering correctly).

Parameters.

ParameterDescription
IPDFDocument handle.
FileName / Buffer,BufSizeThe SVG source.
PosX, PosY, Width, HeightPlacement box.
FlagsAccepted but silently dropped.

Return value. True on success; False if the file doesn't exist / buffer is empty, or the SVG failed to parse.

C# (P/Invoke)

wrappers/dotnet/LumasPdf.cs
[return: MarshalAs(UnmanagedType.Bool)]
Area
Core SDK
Category

Core

Exported names

pdfInsertSVGA pdfInsertSVGW

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.