4D v13

SVG_New

Home

 
4D v13
SVG_New

SVG_New 


 

SVG_New {( width ; height {; title {; description {; rectangle {; display}}}} )} -> Function result 
Parameter Type   Description
width  Longint in Document width
height  Longint in Document height
title  String in Document title
description  String in Description
rectangle  Boolean in Set viewbox
display  Integer in Picture display format
Function result  SVG_Ref in SVG object reference

The SVG_New command creates a new SVG document and returns its reference number.

The optional width and height parameters can be used to limit the space of the SVG document to the dimensions indicated. These 2 parameters are expected in user points ('px'); if you want to specify another unit, you must use the SVG_SET_DIMENSIONS command.

The optional title and description parameters can be used to give information about the contents.

If you pass True in the optional rectangle parameter, the viewbox ('viewBox' attribute) is automatically set to the size of the document created.

Note: It is possible to modify the coordinates of the graphic viewbox and to adjust the fitting of the picture to it more precisely using the SVG_SET_VIEWBOX command.

The optional display parameter can be used to indicate whether the graphic must be fitted to the size of the document. You can pass one of the following 4D picture display format constants as parameter: Scaled to fit prop centered or Scaled to Fit.

The command returns a 16-character string (SVG_Ref) that consists of the reference in memory of the document virtual structure. This reference must be used with the other commands of the component.

Important: Once you no longer need it, do not forget to call the SVG_CLEAR command with this reference in order to free up the memory.

Example  

 svgRef:=SVG_New
 svgRef:=SVG_New(500;200)
 svgRef:=SVG_New(900;700;"SVG component test";"This is an example";True;Scaled to Fit)

 
PROPERTIES 

Product: 4D
Theme: Documents
Number: 65999

 
INDEX

Alphabetical list of commands

 
HISTORY 

Created: Composant 4D SVG v11.3

 
SEE ALSO 

SVG_CLEAR
SVG_Copy
SVG_Open_file