Svg-to-dxf - Resize image

Hi, I am converting svg images to dxf. however the size of the images are different.
I need to resize the converted dxf file, to increase it size.

I tries setting scale and also resizing the original svg, but the converted dxf file is always the same size.

Any ideas how to achieve that. I have paid license for Aspose.Imaging for c#

Hello, @AsmitaAgrawal ,
To change SVG size and convert to DXF please try this code:

public void SvgToDxf(string inputFilePath, string outputFilePath, int newWidth, int newHeight)
{
    outputFilePath = Path.ChangeExtension(outputFilePath, ".dxf");

    using (var image = Image.Load(inputFilePath))
    {
        image.Resize(image.Width * 2, image.Height * 2);
        image.Save(outputFilePath);

        // or
        //image.Save(outputPath, new DxfOptions
        //{
        //   VectorRasterizationOptions = new VectorRasterizationOptions
        //   {
        //       PageSize = new SizeF(image.Width * 2, image.Height),
        //   }
        //});
    }
}

Hope this helps!

1 Like