ImageGear .NET v24.14 - Updated September 15, 2020
CAD to SVG
User Guide > How to Work with... > CAD > How To ... > Convert ... > CAD to SVG

The CADViewer demo demonstrates this functionality. See Samples.

The following CADtoSVG sample illustrates how you can create a SVG page from a CAD page:

C#
Copy Code
using System.IO;
using ImageGear.Formats;
using ImageGear.Formats.CAD;

public static void CadToImage(string inPath, string outPath)
{
    ImGearCADPage page = null;

    // Load file.
    using (FileStream fileStream = new FileStream(inPath, FileMode.Open, FileAccess.Read, FileShare.Read))
    {
        page = ImGearFileFormats.LoadPage(fileStream, 0);
    }

    // Save a CAD file to a PNG image
    ImGearSavingFormats formatOut = ImGearSavingFormats.SVG;
    using (FileStream fileStream = new FileStream(outPath, FileMode.Create, FileAccess.Write, FileShare.Read))
    {
        ImGearFileFormats.SavePage(page, fileStream, formatOut);
    }
}
Any conversions made to the CADPage’s camera will reflect in the saved SVG file.