CAD2PDF.cs - using using using using using System...

This preview shows page 1 - 3 out of 6 pages.

using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; using ImageGear.Evaluation; using ImageGear.Formats; using ImageGear.Formats.CAD; using System.IO; namespace AutoCADto2DPDF { class CAD2PDF { /* * CADPDFSaveOptions BuildPDFOptions(String pdfVersion, String dimensions) * * Sets the options for the CADPDFSaveOptions object. This is used by the ImGearCADPage * object for importing the CAD file and saving it as a PDF document. * * * * Inputs: * String pdfVersion: The PDF version the converted file will be saved as. Inputs are * in the format "PDFv1_3" - "PDFv1_7". * The default is "PDFv1_7". * String dimensions: This sets whether if the PDF file will be saved as 2D or 3D. Settings: * "2D", "3D". * The default is "2D". * * Returns: CADPDFSaveOptions object * * */ public static CADPDFSaveOptions BuildPDFOptions(String pdfVersion, String dimensions) { CADPDFSaveOptions options = new CADPDFSaveOptions(); // General PDF metadata information. switch(pdfVersion) { case "PDFv1_3": options.PDFVersion = CADPDFSaveOptions.PDFVersionOption.PDFv1_3; break; case "PDFv1_4": options.PDFVersion = CADPDFSaveOptions.PDFVersionOption.PDFv1_4; break; case "PDFv1_5":
options.PDFVersion = CADPDFSaveOptions.PDFVersionOption.PDFv1_5; break; case "PDFv1_6": options.PDFVersion = CADPDFSaveOptions.PDFVersionOption.PDFv1_6; break; case "PDFv1_7": default: options.PDFVersion = CADPDFSaveOptions.PDFVersionOption.PDFv1_7; break; } options.PDFVersion = CADPDFSaveOptions.PDFVersionOption.PDFv1_7; options.Title = "Convert CAD to PDF with ImageGear .NET"; options.Author = "Accusoft"; options.Subject = "Convert CAD to PDF with ImageGear .NET"; options.Keywords = "Accusoft,CAD,PDF"; options.Creator = "Accusoft"; options.Producer = "Accusoft"; // The DPI (dots per inch) for hatch exporting options.HatchDPI = 72; // The DPI (dots per inch) for vector exporting options.GeometryDPI = 72; // PRC Mode specifies whether to output as a 2D or 3D PDF file.

  • Left Quote Icon

    Student Picture

  • Left Quote Icon

    Student Picture

  • Left Quote Icon

    Student Picture