Hello,
I am using aspose.imaging to convert svg to dxf.
Here is my current code:
using (var image = Aspose.Imaging.Image.Load(filePath))
{
// Create an instance of DxfOptions
var exportOptions = new Aspose.Imaging.ImageOptions.DxfOptions() { TextAsLines = true, ConvertTextBeziers = true };
Aspose.Imaging.ImageOptions.VectorRasterizationOptions rasterizationOptions = new Aspose.Imaging.ImageOptions.SvgRasterizationOptions();
rasterizationOptions.PageWidth = image.Width;
rasterizationOptions.PageHeight = image.Height;
rasterizationOptions.FullFrame = false;
exportOptions.VectorRasterizationOptions = rasterizationOptions;
// Save svg to dxf
image.Save(Path.Combine(saveFolder, $"{Path.GetFileNameWithoutExtension(filePath)}_{DateTime.Now:yyyyMMddHHmmssffff}.dxf"), exportOptions);
}
Right now I have 2 problems
1、All the converted dxf will have a frame outside the graphic which svg not.
2、Some line type, eg. dashed line in svg cannot be set correctly in dxf.
You could see the svg and converted dxf in the attachments. Please help update these.
Thank you!
test.7z (11.5 KB)