Home
Categories
Dictionary
Download
Project Details
FAQ
License

tosvg converter insets parameter


The ConverterParameters.insets parameter allows to add an insets around the svg or Graphics2D result.

Example

Suppose the following code:
   Polyline polyline = new Polyline();
   polyline.getPoints().addAll(new Double[]{0.0, 0.0, 0.0, 100.0, 100.0, 100.0});
   polyline.setStroke(Color.RED);
   converter.convert(polyline, <my SVG file>);     
By default we will have the following svg content:
   <svg height="101.0" width="101.0" xmlns="http://www.w3.org/2000/svg" xmlns:svg="http://www.w3.org/2000/svg">
      <defs/>
      <polyline fill="none" points="0.0,0.0 0.0,100.0 100.0,100.0 " style="stroke:rgb(255,0,0);"/>
   </svg>
With the following result:
tosvgNoinsets
But with an insets of 2:
   <svg height="105.0" width="105.0" xmlns="http://www.w3.org/2000/svg" xmlns:svg="http://www.w3.org/2000/svg">
      <defs/>
      <g transform="translate(2.0 2.0)">
         <polyline fill="none" points="0.0,0.0 0.0,100.0 100.0,100.0 " style="stroke:rgb(255,0,0);"/>
      </g>
   </svg>
With the following result:
tosvgInsets

See also


Categories: Tosvg

Copyright 2021-2022 Herve Girod. All Rights Reserved. Documentation and source under the BSD-3-Clause License