You can find all details at: Convert STL to PDF or PNG Image Programmatically in C#
Last active
August 2, 2021 19:59
-
-
Save aspose-com-gists/13267b3c65f32abbd9709e85efc0f31a to your computer and use it in GitHub Desktop.
Convert STL to PDF PNG Image Programmatically with C#
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
// Specify path for input STL file | |
string sourceFilePath = dataDir + "galeon.stl"; | |
// Load input STL image | |
using (var cadImage = (CadImage)Image.Load(sourceFilePath)) | |
{ | |
// Initialize PdfOptions class instance | |
PdfOptions pdfOptions = new PdfOptions(); | |
string outPath = sourceFilePath + "test.pdf"; | |
// Convert STL to PDF | |
cadImage.Save(outPath, pdfOptions); | |
} |
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
// Specify path for input STL file | |
string sourceFilePath = dataDir + "galeon.stl"; | |
// Load input STL image | |
using (var cadImage = (CadImage)Image.Load(sourceFilePath)) | |
{ | |
// Initialize PngOptions class instance | |
PngOptions pngOptions = new PngOptions(); | |
string outPath = sourceFilePath + "test.png"; | |
// Convert STL to PNG | |
cadImage.Save(outPath, pngOptions); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment