Textual Wmf to Png conversion in C#

Support textual Wmf to Png conversion

Issue : When converting WMF file to PNG, the text position and style can change.

Tips : It is necessary to change the RenderMode property to Auto in WmfRasterizationOptions.

Example :

using Aspose.Imaging;
using Aspose.Imaging.FileFormats.Jpeg2000;
using Aspose.Imaging.ImageOptions;
using System.Collections.Generic;
using System.IO;
using Aspose.Imaging;
using Aspose.Imaging.FileFormats.Wmf;
using Aspose.Imaging.ImageOptions;
using System;
using System.IO;
string templatesFolder = @"c:\Users\USER\Downloads\templates\";
string dataDir = templatesFolder;
string FileName = "template.wmf";
string inputFileName = Path.Combine(templatesFolder, FileName);
string outputFileName = inputFileName + ".png";
using (Image image = Image.Load(inputFileName))
{
WmfRasterizationOptions rasterizationOptions = new WmfRasterizationOptions()
{
RenderMode = WmfRenderMode.Auto,
PageSize = image.Size
};
image.Save(outputFileName, new PngOptions() { VectorRasterizationOptions = rasterizationOptions });
}
File.Delete(outputFileName);