Scale lines in SVG

Change line scale when exporting to SVG

You can control the scale of the lines in the SVG file, the Aspose.CAD library provides all the necessary tools for this.

Use the LineScale parameter in VectorRasterizationOptions to control the scale of the lines

Example code:

string fileName = "exampleFile";
string file = string.Format("{0}.plt", fileName);
string outFile = string.Format("{0}.svg", fileName);
using (FileStream inStream = new FileStream(file, FileMode.Open))
using (Image image = Image.Load(inStream))
using (FileStream stream = new FileStream(outFile, FileMode.Create))
{
ImageOptionsBase options = new SvgOptions();
options.VectorRasterizationOptions = new CadRasterizationOptions
{
LineScale = 0.25f
};
image.Save(stream, options);
}

A file using a linear scale

  1. The file if the LineScale parameter is set to 0.25.
    Input image
  2. File if you don’t use line scaling.
    Input image