public static void Run()
        {
            //ExStart:DWGToCompliancePDF
            // The path to the documents directory.
            string MyDir          = RunExamples.GetDataDir_DWGDrawings();
            string sourceFilePath = MyDir + "Bottom_plate.dwg";

            Aspose.CAD.Image cadImage = Aspose.CAD.Image.Load(sourceFilePath);
            // Create an instance of CadRasterizationOptions and set its various properties
            Aspose.CAD.ImageOptions.CadRasterizationOptions rasterizationOptions = new Aspose.CAD.ImageOptions.CadRasterizationOptions();
            rasterizationOptions.BackgroundColor = Aspose.CAD.Color.White;
            rasterizationOptions.PageWidth       = 1600;
            rasterizationOptions.PageHeight      = 1600;


            // Create an instance of PdfOptions
            PdfOptions pdfOptions = new Aspose.CAD.ImageOptions.PdfOptions
            {
                VectorRasterizationOptions = rasterizationOptions
            };

            pdfOptions.CorePdfOptions = new PdfDocumentOptions();

            pdfOptions.CorePdfOptions.Compliance = PdfCompliance.PdfA1a;
            cadImage.Save(MyDir + "PDFA1_A.pdf", pdfOptions);

            pdfOptions.CorePdfOptions.Compliance = PdfCompliance.PdfA1b;
            cadImage.Save(MyDir + "PDFA1_B.pdf", pdfOptions);
            //ExEnd:DWGToCompliancePDF
            Console.WriteLine("\nThe DWG file exported successfully to PDF.\nFile saved at " + MyDir);
        }
        public static void Run()
        {
            //ExStart:SupportOfBlockClipping
            // The path to the documents directory.
            string MyDir = RunExamples.GetDataDir_DXFDrawings();

            string inputFile  = MyDir + "SLS-CW-CD-CE001-R01_blockClip.dxf";
            string outputFile = MyDir + "SLS-CW-CD-CE001-R01_blockClip.pdf";

            using (CadImage cadImage = (CadImage)Image.Load(inputFile))
            {
                var rasterizationOptions = new Aspose.CAD.ImageOptions.CadRasterizationOptions
                {
                    BackgroundColor = Aspose.CAD.Color.White,
                    DrawType        = Aspose.CAD.FileFormats.Cad.CadDrawTypeMode.UseObjectColor,
                    PageWidth       = 1200,
                    PageHeight      = 1600,
                    BorderX         = 30,
                    BorderY         = 5,

                    Layouts = new string[] { "Model" }
                };

                PdfOptions pdfOptions = new Aspose.CAD.ImageOptions.PdfOptions
                {
                    VectorRasterizationOptions = rasterizationOptions
                };

                cadImage.Save(outputFile, pdfOptions);
                //ExEnd:SupportOfBlockClipping
            }
        }
Example #3
0
        public static void Run()
        {
            //ExStart:SupportOfLayers
            // The path to the documents directory.
            string MyDir          = RunExamples.GetDataDir_DXFDrawings();
            string sourceFilePath = MyDir + "for_layers_test.dwf";

            using (Aspose.CAD.Image image = Aspose.CAD.Image.Load(sourceFilePath))
            {
                //  Create an instance of CadRasterizationOptions and set its various properties
                Aspose.CAD.ImageOptions.CadRasterizationOptions rasterizationOptions = new Aspose.CAD.ImageOptions.CadRasterizationOptions();
                rasterizationOptions.PageWidth  = 1600;
                rasterizationOptions.PageHeight = 1600;

                // Add desired layers
                rasterizationOptions.Layers = new string[] { "LayerA" };

                rasterizationOptions.CenterDrawing = true;

                JpegOptions jpegOptions = new JpegOptions();
                jpegOptions.VectorRasterizationOptions = rasterizationOptions;

                MyDir = MyDir + "for_layers_test.jpg";
                // Export the DXF to JPG
                image.Save(MyDir, jpegOptions);
            }
            //ExEnd:SupportOfLayers
        }
Example #4
0
        public static void Run()
        {
            //ExStart:Export3DImagestoPDF
            // The path to the documents directory.
            string MyDir = RunExamples.GetDataDir_ConvertingCAD();
            string sourceFilePath = MyDir + "conic_pyramid.dxf";
            using (Aspose.CAD.Image cadImage = Aspose.CAD.Image.Load(sourceFilePath))
            {
                Aspose.CAD.ImageOptions.CadRasterizationOptions rasterizationOptions = new Aspose.CAD.ImageOptions.CadRasterizationOptions();
                rasterizationOptions.PageWidth = 500;
                rasterizationOptions.PageHeight = 500;
                rasterizationOptions.TypeOfEntities = TypeOfEntities.Entities3D;

                rasterizationOptions.Layouts = new string[] { "Model" };
                PdfOptions pdfOptions = new PdfOptions();
                pdfOptions.VectorRasterizationOptions = rasterizationOptions;
                MyDir = MyDir + "Export3DImagestoPDF_out.pdf";
                cadImage.Save(MyDir, pdfOptions);
            }
            //ExEnd:Export3DImagestoPDF            
            Console.WriteLine("\n3D images exported successfully to PDF.\nFile saved at " + MyDir);
        }