Whenever I try to add a WMF file into a PDF, the page that has it does not display it correctly. I am attaching the WMF I am using here.
I can browse the WMF file in Windows Explorer, paste it into MS Paint, all other viewing of it works fine, but when adding into Spire.PDF it is distorted, image is too small while the text is too huge, it's all scrunched up in the upper left corner of the page, and other anomalies. I have tried changing the PdfMetafile's PageUnit and PageScale, I have adjusted the size used on the Page.Canvas.Draw, just about everything I can think of to make this work. I do know that when this WMF is turned into a Bitmap and that Bitmap is inserted into the page, it looks just fine, however this is not the desired result as want a text searchable PDF and a raster image is not searchable.
The code below is mostly what I am using to do this, edited to keep non-PDF related source out as it's a long func otherwise. If you see any obvious issues with it, I'd appreciate knowing. Thanks!
var pdf = new PdfDocument());
pdf.PageSettings.SetMargins(0, 0, 0, 0);
PdfSection section = pdf.Sections.Add();
var bmp = new PdfMetafile((Metafile)sketchPage.Image); // sketchPage.Image is a Metafile object that was exported to create the attached WMF
PdfPageBase pdfPage = section.Pages.Add();
pdfPage.Canvas.DrawImage(bmp, 1F, 1F, pdfPage.ActualSize.Width, pdfPage.ActualSize.Height);
pdfPage.Canvas.Save();
pdf.SaveToFile(pdfSaveFileDialog.FileName);
pdf.Close();