In this example topic, you’ll learn how to convert WMF to PDF with NET REST API. We will develop a WMF to PDF converter with C# Low Code API by adhering to the detailed and simple steps mentioned in the following section. This application can be utilized with any .NET application supported in macOS, Windows, or Linux environments and conversion can be done for free.
Prerequisite
- Create an account and get API credentials to perform WMF to PDF conversion
- Download Aspose.Imaging Cloud SDK for .NET to convert WMF to PDF
- Setup C# .NET project with the above SDK to render WMF as PDF
Steps to Convert WMF to PDF with NET REST API
- Set the Client ID and Client Secret for the API to convert WMF to PDF
- Create an instance of ImagingAPI class with client credentials to perform WMF to PDF conversion
- Specify the source WMF and output PDF file names
- Read the source WMF file and upload it to cloud storage
- Create an instance of the ConvertImageRequest with input WMF file stream and output PDF format
- Call the ConvertImage method to convert WMF to PDF with NET REST API
- Save the rendered PDF file stream on the local disk
The aforementioned renders the file type from WMF to PDF with C# Low Code API. We will start with the configuration of the SDK by initializing the ImagingAPI class object. We will then load the source WMF file using a FileStream and create an instance of the ConvertImageRequest class object that will further be used to perform the conversion to a PDF using the ConvertImage() method.
Code for WMF to PDF Conversion in NET Low Code API
This crisp example code demonstrates how to convert WMF to PDF with C# Cloud API. After fulfilling the pre-requisite requirements, you need to provide a path for the source WMF image on the disk and by utilizing the Aspose.Imaging REST API SDK performs the conversion to PDF. The PDF file stream is returned after the conversion is done and you can then save it locally on the disk.
In this basic article, we have covered to transform WMF to PDF with Cloud API. If you are interested in performing PSD to PDF conversion, refer to the article on how to Convert PSD to PDF with NET REST API.