A4大小的emf文件通过Aspose.Imageing 转为PDF后,文件的大小错误image.png (2.1 KB)
,是哪里出错了
代码如下:
using (var image = (EmfImage)Image.Load(filePath))
using (FileStream outputStream = new FileStream(outputfile, FileMode.Create))
{
if (!image.Header.EmfHeader.Valid)
{
throw new ImageLoadException(string.Format(“The file {0} is not valid”, outputfile));
}
EmfRasterizationOptions emfRasterization = new EmfRasterizationOptions();
emfRasterization.PageWidth = image.Width*72/600;
emfRasterization.PageHeight = image.Height*72/600;
//emfRasterization.BackgroundColor = Color.WhiteSmoke;
PdfOptions pdfOptions = new PdfOptions();
pdfOptions.VectorRasterizationOptions = emfRasterization;
image.Save(outputStream, pdfOptions);
}
还有如要转成的PDF如何设置页边距?