emf文件通过Aspose.Imageing for net 转为PDF文件时,PDF内容错误:代码如下
string outPath = filePath + “.pdf”;
using (var image = (EmfImage)Image.Load(filePath))
using (FileStream outputStream = new FileStream(outPath, FileMode.Create))
{
if (!image.Header.EmfHeader.Valid)
{
throw new ImageLoadException(string.Format("The file {0} is not valid", outPath));
}
EmfRasterizationOptions emfRasterization = new EmfRasterizationOptions();
emfRasterization.PageWidth = image.Width;
emfRasterization.PageHeight = image.Height;
emfRasterization.BackgroundColor = Color.WhiteSmoke;
PdfOptions pdfOptions = new PdfOptions();
pdfOptions.VectorRasterizationOptions = emfRasterization;
image.Save(outputStream, pdfOptions);
}
emf文件:1.emf,转PDF结果文件:1.pdf附加文件.zip (38.8 KB)