版本:aspose.pdf 21.4,
环境:linux+docker ,已经安装libgdiplus
在pdf文档生成图片的时候,图片已经生成了,但是在生成图片上面丢失了pdf文档上原有的图片.
windows 上没有问题.
在linux+docker的环境下,pdf保存到svg没问题.
code: using (var pdfDocument = new Aspose.Pdf.Document(inputFile))
{
if (pdfDocument.Pages.Count > 0)
{
RenderingOptions opts = new RenderingOptions();
opts.UseFontHinting = true;
using (FileStream imageStream = new FileStream(newFileName, FileMode.Create))
{
Resolution resolution = new Resolution(300);
PngDevice pngDevice = new PngDevice(resolution);
pngDevice.RenderingOptions = opts;
pngDevice.Process(pdfDocument.Pages[1], imageStream);
imageStream.Close();
}
}
}