// Load an existing WMF image<o:p></o:p>
using (Aspose.Imaging.Image image = Aspose.Imaging.Image.Load("c:/pdftest/sample.wmf"))
// Create an instance of EmfRasterizationOptions class and set different properties
Aspose.Imaging.ImageOptions.EmfRasterizationOptions emfRasterizationOptions = new Aspose.Imaging.ImageOptions.EmfRasterizationOptions();
emfRasterizationOptions.BackgroundColor = Aspose.Imaging.Color.WhiteSmoke;
emfRasterizationOptions.PageWidth = image.Width;
emfRasterizationOptions.PageHeight = image.Height;
// Create an instance of PdfOptions class and provide rasterization option
Aspose.Imaging.ImageOptions.PdfOptions pdfOptions = new Aspose.Imaging.ImageOptions.PdfOptions();
pdfOptions.VectorRasterizationOptions = emfRasterizationOptions;
// Call the save method, provide output path and PdfOptions to convert the WMF file to PDF and save the output
Thanks for the replies, however my goal was to use something that didn’t require loading a file from disk, but could use the .Net Metafile directly in memory. Unfortunately it doesn’t sound like there’s anything available for that.
Thanks for the reply.
I see that the two issues noted here have been set to postponed. Is there any sort of timeframe for when we can expect these fixes to be put in place? We are still having to drag along the Aspose Words API with our installations, which we are keen to avoid and to just be able to make use of the PDF control.
Any update you can provide is appreciated.
The linked ticket IDs IMAGINGNET-2400 and PDFNET-35082 are not resolved yet. These tickets could take time because their implementation is long, and other high priority tickets are in queue. In order to escalate priority, we recommend our clients to post their critical issues in the paid support forum. You can also post these ticket IDs in the paid support forum. Please refer to this help topic: Paid Support Helpdesk
The issues you have found earlier (filed as PDFNET-35082) have been fixed in Aspose.PDF for .NET 19.1.