Macro Language Reference > PIs > Text > <?inlinesvg>
  
<?inlinesvg>
Description
This command PI and its parameters allow an SVG file to be placed inline in a normal PTC ALD stream.
 
Example 467. Use inline SVG to create a graphics object and place using inline Maths
The following is an example of an SVG style that creates a new graphics object via the following options:
Creates a tag name with a unique number
Calculates the start position of the SVG element from the parent stream (i.e. the stream containing the SVG element that called this style) using getvars
Imports the SVG
Instructs the PTC ALD formatting engine to ignore the SVG element and its children
Places the resulting graphic object in the stream using Inline Maths
<?show "^svggfx"svggr$x(0)+1x(0)>
<^?inlinesvg "^svggfx","^11835(-1)",^21843(^21836(-1))>
<^?attr 4,-1,^21852(^21843(^21836(-1)))>
<?show [$$]\\object(100truemm,p)=="$^svggfx"[$$]>
Syntax
<?inlinesvg graphics:s stream:s ( ( node_id:n ) | ( start:n end:n ) )
graphics
The name of the PTC ALD graphic object into which the SVG file will be drawn
stream
The name of the PTC ALD stream that contains the SVG file
node_id
The number of the node in the XML tree of the root SVG element to be processed
start
The start character position of the root SVG element (in case the stream containing the SVG file is not well-formed XML)
end
The end character position of the root SVG element (in case the stream containing the SVG is not well-formed XML).
Additional Information
This processing instruction will read the specified SVG element and automatically import it into the specified graphics object. You must then use relevant methods to place the PTC ALD graphics object in the correct position in the document, e.g. by placing the graphic in a frame or by using the inline Maths commands to draw the graphic in a text stream.
Multiple SVG elements can be drawn into different PTC ALD graphics objects using this command, provided the SVG elements all exist in the same XML document. In this case, either the node id or start or end character positions of each SVG file must be specified.
 
The inline SVG operation uses the SVG Importer described in Technote 0088: Scalable Vector Graphics, so is subject to the same limitations. For this operation, the following defaults have been set: a pixel conversion rate of 1 pixel = 0.2822mm(72 dpi) and an ellipse accuracy of 15. It should also be noted that any errors or unsupported warnings are suppressed during the inline SVG method.
SVG printer driver
The SVG printer driver outputs all colours using the RGB function, i.e. rgb(r,g,b). The SVG 1.1 specification does not yet support CMYK colors, though this is expected in SVG 1.2.
SVG Importer
The SVG importer is usually limited to RGB values for colors, plus named colors from the CSS color range. There is, however, an extension that adds support for CMYK colors, e.g. fill="x3b2:cmyk(c,m,y,k)". The "x3b2:" prefix on the color name tells the SVG Importer to let PTC ALD resolve the color itself: you are then free to use colors of your choice via the cmyk() functions, Pantone color names, etc.
For more information, see Technote 0088: Scalable Vector Graphics.