public static void Run()
{
// ExStart:ConvertWMFToPDF
// The path to the documents directory.
string dataDir = RunExamples.GetDataDir_ModifyingAndConvertingImages();
// Load an existing WMF image
using (Image image = Image.Load(dataDir + "input.wmf"))
{
// Create an instance of EmfRasterizationOptions class and set different properties
EmfRasterizationOptions emfRasterizationOptions = new EmfRasterizationOptions();
emfRasterizationOptions.BackgroundColor = Color.WhiteSmoke;
emfRasterizationOptions.PageWidth = image.Width;
emfRasterizationOptions.PageHeight = image.Height;
// Create an instance of PdfOptions class and provide rasterization option
PdfOptions pdfOptions = new PdfOptions();
pdfOptions.VectorRasterizationOptions = emfRasterizationOptions;
// Call the save method, provide output path and PdfOptions to convert the WMF file to PDF and save the output
image.Save(dataDir + "ConvertWMFToPDF_out.pdf", pdfOptions);
}
// ExEnd:ConvertWMFToPDF
}
}