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

The following CADto3DPDF sample illustrates how you can create a 3D PDF from a CAD page:

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

public static void CadTo3DPdf(string inFile, string outFile)
{
    ImGearCADPage page = null;

    // Load the file.
    using (FileStream fileStream = new FileStream(inFile, FileMode.Open, FileAccess.Read))
    {
        page = (ImGearCADPage)ImGearFileFormats.LoadPage(fileStream);
    }

    // Save the CAD file as a 3D PDF file.
    CADPDFSaveOptions options = new CADPDFSaveOptions();
    options.PRCMode = CADPDFSaveOptions.PRCModeOption.BREP;
    page.SaveOptions["PDFSaveOptions"] = options;

    using (FileStream fileStream = new FileStream(outFile, FileMode.Create, FileAccess.Write))
    {
        ImGearFileFormats.SavePage(page, fileStream, ImGearSavingFormats.PDF);
    }
}
Setting the PRCMode option to either BREP or MESH should output a 3D PDF. It is recommended that PRCAllInSingleView be set to true so the CAD page will export to a single PDF page.