STP Drawings
Contents
[
Hide
]Exporting STP Format To PDF
Aspose.CAD for .NET allows developers to export an STP file to PDF format. STP to PDF conversion approach works as follows:
- Load STP drawing file using the Image.Load factory method.
- Create an object of the CadRasterizationOptions class and set the PageHeight & PageWidth properties.
- Create an object of the PdfOptions class and set the VectorRasterizationOptions property.
- Call Image.Save while passing an object of PdfOptions as the second parameter.
Sample Code
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
string inputFile ="file.stp"; | |
using (Image image = Image.Load(inputFile)) | |
{ | |
// Initialize PdfOptions class object | |
PdfOptions options = new PdfOptions(); | |
CadRasterizationOptions cadRasterizationOptions = new CadRasterizationOptions(); | |
cadRasterizationOptions.PageHeight = 500; | |
cadRasterizationOptions.PageWidth = 500; | |
options.VectorRasterizationOptions = cadRasterizationOptions; | |
// Export STP to PDF | |
string outPath = "output.pdf"; | |
image.Save(outPath, options); | |
} |