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);