Does PDFNet support conversion of windows WMF or EMF metafile to PDF?

Q: Does the PDFNet SDK currently support conversion of windows .wmf or .emf metafile data to PDF?


PDFNet includes PDFDC and PDFDCEx classes (on Windows) that can be used to convert EMF or GDI commands to PDF:

You can also to convert EMF/WMF directly using pdftron.PDF.Convert.ToPdf(“my.emf”) as shown in Convert sample project:

Another way to convert Windows Metafile to PDF is using PDFDCEX. This approach has a few advantages (like better conversion etc) over PDFDC/FromEMF():


using (PDFDCEX pdfdcex = new PDFDCEX())

using (PDFDoc pdfdoc = new PDFDoc()) {
string emf_file_path = input_path + “simple-emf.emf”;
using(Graphics gr = pdfdcex.StartPage()) {
using(Metafile img = new Metafile(emf_file_path)) {
gr.DrawImage(img, 0, 0);
pdfdoc.Save(output_path + “mem_test.pdf”, SDFDoc.SaveOptions.e_linearized);

Full sample code is attached

PDFDCTest.cs (2.19 KB)