Skip to content

Instantly share code, notes, and snippets.

@aspose-com-gists
Created October 2, 2025 21:07
Show Gist options
  • Save aspose-com-gists/fb177f0712d136eccff213373c9615fc to your computer and use it in GitHub Desktop.
Save aspose-com-gists/fb177f0712d136eccff213373c9615fc to your computer and use it in GitHub Desktop.
Develop a DXF to SVG Converter in C#
// Define the path for the working directory.
string MyDir = "files";
string sourceFilePath = MyDir + "conic_pyramid.dxf";
// Load the source DXF file by calling the load method.
using (Aspose.CAD.Image image = Aspose.CAD.Image.Load(sourceFilePath))
{
// Create an object of CadRasterizationOptions
Aspose.CAD.ImageOptions.CadRasterizationOptions rasterizationOptions = new Aspose.CAD.ImageOptions.CadRasterizationOptions();
// Define page width & height.
rasterizationOptions.PageWidth = 1200;
rasterizationOptions.PageHeight = 1200;
// Instantiate an instance of the SvgOptions for the resultant SVG image.
var options = new Aspose.CAD.ImageOptions.SvgOptions();
// Set rasterization options.
options.VectorRasterizationOptions = rasterizationOptions;
MyDir = MyDir + "conic_pyramid_raster_image_out.svg";
// Save resultant image by calling the Save method.
image.Save(MyDir, options);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment