DynaPDF Manual - Page 608
Previous Page 607 Index Next Page 609

Function Reference
Page 608 of 883
SVG files are available in different flavors. Regular SVG files contain exactly one graphic but SVG
files can also contain more than one graphic or symbol. Such symbol files contain no visible graphic
if loaded without a symbol name.
In order to determine which kind of SVG file we have in memory, the function
GetSVGSymbolCount() must be called after the SVG file was loaded.
If the return value is greater zero, the file contains multiple symbols. In such a case the desired
symbol name must be passed to InsertSVG(), otherwise there is no visible output.
The symbol names that a SVG file contains can be accessed with GetSVGSymbolName(). The
function accepts an index from 0 through GetSVGSymbolCount() -1.
Return values:
If the function succeeds the return value is a pointer of the SVG parser instance. If the function fails,
the return value is NULL.
LoadSVGFromBuffer
Syntax:
ISVG* pdfLoadSVGFromBuffer(
const PPDF* IPDF,
// Instance pointer
const void* Buffer, // SVG file buffer
UI32 BufSize)
// Buffer size in bytes
The function opens a SVG file and returns the SVG parser instance on success like LoadSVG(), but
accepts a file buffer as input. See LoadSVG() for further information.
Notice:
The caller is responsible to delete the parser instance when finish with DeleteSVG(). This pointer
is not maintained by DynaPDF. That means if you forget to delete the parser instance a memory
leak will occur.
The PHP extension is an exception in this regard. The PHP extension makes sure that the
instance will be deleted when it becomes out of scope.
Note also that the SVG parser instance contains a reference of the PDF instance and this instance
pointer cannot be changed at runtime. The PDF instance is used to output errors and warning to
the error log.
The buffer can be deleted after the function returned.
Return values:
If the function succeeds the return value is a pointer of the SVG parser instance. If the function fails,
the return value is NULL.
Previous topic: LoadLayerConfig, LoadSVG
Next topic: LockLayer, MarkTemplateAsWatermark, MovePage