DynaPDF Manual - Page 595
Previous Page 594 Index Next Page 596

Function Reference
Page 595 of 883
InsertSVG
Syntax:
LBOOL pdfInsertSVG(
const PPDF* IPDF,
// Instance pointer
const ISVG* ISVG,
// SVG Parser instance
const char* SymbolID, // Optional UTF-8 encoded symbol name
double PosX,
// Destination x-coordinate
double PosY,
// Destination y-coordinate
double Width,
// Destination width
double Height,
// Destination height
TSVGFlags Flags)
The function places a SVG graphic on the currently open page, template, or pattern.
As described at LoadSVG(), a symbol name is might be required in order to load the desired symbol
or graphic.
This is a native SVG-to-PDF converter that translates SVG graphics directly into PDF drawing
operations and resources. Vector graphics remain vector-based whenever possible, preserving their
scalability and rendering quality.
The converter supports commonly used SVG features including paths and basic shapes,
transformations, clipping, text, gradients, patterns, reusable elements, symbols, nested SVG
documents, viewports and view boxes, as well as a subset of CSS relevant to SVG rendering.
SVG files containing multiple embedded SVG graphics can be enumerated and individual graphics
can be selected by their symbol id. This makes it possible to efficiently process SVG icon and symbol
collections without extracting the individual SVG documents beforehand.
The converter includes protection against cyclic and recursive references and is designed to handle
malformed or unsupported SVG constructs gracefully.
DynaPDF implements the SVG features required for a broad range of real-world SVG documents
but full conformance with every feature of the SVG and CSS specifications is not provided.
SVG Graphics are drawn into a clipping path so that contents outside the bounding box of the
graphic remains invisible.
Positioning & Scaling
If top down coordinates are active (see SetPageCoords() for further information), PosX / PosY is the
upper left corner of the graphic. If bottom up coordinates are active, PosX / PosY is the lower left
corner of the graphic.
The width and height can be calculated as follows:
• If Width and Height is 0 the function uses the original width or height from the svg file.
Previous topic: IsEmptyPage, IsWrongPwd
Next topic: LineAnnot, Measure lines