You can find more details at: Convert DWF to PNG or JPG Image in C#
Last active
March 16, 2022 08:18
-
-
Save aspose-com-gists/798e87ec5644ab94972f766bd61fdd79 to your computer and use it in GitHub Desktop.
Convert DWF to PNG or JPG JPEG Image Programmatically in C# .NET
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 = "blocks_and_tables.dwf"; | |
using (Image image = Image.Load(inputFile)) | |
{ | |
// Initialize JpegOptions class object | |
JpegOptions jpgOptions = new JpegOptions(); | |
CadRasterizationOptions dwfRasterizationOptions = new CadRasterizationOptions(); | |
jpgOptions.VectorRasterizationOptions = dwfRasterizationOptions; | |
dwfRasterizationOptions.PageHeight = 500; | |
dwfRasterizationOptions.PageWidth = 500; | |
// Export DWF to JPG image | |
string outPath = "blocks_and_tables.jpg"; | |
image.Save(outPath, jpgOptions); | |
} |
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 = "blocks_and_tables.dwf"; | |
// Load the input DWF file | |
using (Image image = Image.Load(inputFile)) | |
{ | |
// Initialize PngOptions class object | |
PngOptions pngOptions = new PngOptions(); | |
CadRasterizationOptions dwfRasterizationOptions = new CadRasterizationOptions(); | |
pngOptions.VectorRasterizationOptions = dwfRasterizationOptions; | |
dwfRasterizationOptions.PageHeight = 500; | |
dwfRasterizationOptions.PageWidth = 500; | |
// Export DWF to PNG image | |
string outPath = "blocks_and_tables.png"; | |
image.Save(outPath, pngOptions); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment