svg到pdf使用inkscape会导致内存不足异常

时间:2014-02-17 14:00:31

标签: c# pdf svg out-of-memory inkscape

我有一个使用inkscape的页面,因此将svg图像绘制到pdf文件中。它以前工作但现在我改变了网站上的图像,所以现在它没有。失败的代码是:

XImage image = XImage.FromFile(filePath);

我得到了

  

System.OutOfMemoryException:内存不足

我的代码如下所示:

    private static void DrawImage(XGraphics gfx, string filePath, double imageWidth, double imageHeight, double pagePadding, double beginDrawYPoint)
    {
        if (File.Exists(filePath) == false)
        {
            var f = File.Create(filePath);
        }
        XImage image = XImage.FromFile(filePath);
        gfx.DrawImage(image, pagePadding, pagePadding + beginDrawYPoint, imageWidth, imageHeight);
        gfx.Dispose();
    }

filePath变量如下所示:C:\ Users \ Daniel_2 \ Documents \ Avtryck \ Avtryck-Base.Prod \ AvtryX.Web \ Temp SVG Files \ 3ia45urj.5f5.pdf

0 个答案:

没有答案