DWF files are based on vectors that can consist of CAD drawings, text, images, etc. You may need to create a thumbnail or preview image of a DWF file. In accordance with that, the article covers how to convert a DWF file to a JPG or PNG image programmatically in C#.
- DWF to JPG or PNG Image Converter – C# API Installation
- Convert DWF to JPG Image Programmatically in C#
- Convert DWF to PNG Image Programmatically in C#
DWF to JPG or PNG Image Converter – C# API Installation
Aspose.CAD for .NET API supports converting DWF and several other file formats. You can easily configure the API by downloading its DLL file from the New Releases section or using the following NuGet command:
PM> Install-Package Aspose.CAD
Convert DWF to JPG Image Programmatically in C#
You can convert a DWF file to a JPG image by following the steps:
- Load the input DWF with the Image class.
- Initialize an object of CadRasterizationOptions class.
- Create an instance of JpegOptions class.
- Set the VectorRasterizationOptions and save the output JPG image.
The following code snippet shows how to convert a DWF file to a JPG image programmatically in C#:
Convert DWF to PNG Image Programmatically in C#
You can convert a DWF file to a PNG image with the steps below:
- Load the input DWF file using the Image class.
- Create an instance of CadRasterizationOptions class.
- Create an object of PngOptions type.
- Specify the VectorRasterizationOptions and write the output PNG image.
The code snippet below explains how to convert a DWF file to a PNG image programmatically in C#:
Get Free Temporary License
You can evaluate the API features in their full capacity by requesting a free temporary license.
Conclusion
In this article, you have explored how to convert a DWF file to image formats like PNG or JPG. It explains all the steps and code snippets to perform the conversion programmatically in C#. Moreover, please take a look at the documentation for detailed information about the features supported by the API. Please feel free to reach out to us at the forum in case of any queries.