【发布时间】:2015-12-10 06:58:47
【问题描述】:
我编写了一些代码,用于使用 pechkin 和 pechkin.synchronized 从 HTML 制作 PDF。
第一次会很好用。
自第二次以来,图像在 pdf 中消失了。 其他 [html 到 pdf] 也是如此。第一个pdf是正确的。其他pdf不是。 在服务器第一次使用时,它会工作。
可能是因为 pechkin 不会在内存中卸载。我想。
我需要帮助。
System.IO.File.WriteAllText(textfilepath, html);
GlobalConfig gc = new GlobalConfig();
ObjectConfig oc = new ObjectConfig()
.SetLoadImages(true)
.SetZoomFactor(1.0)
.SetPrintBackground(true)
.SetScreenMediaType(true)
.SetCreateExternalLinks(true)
.SetAllowLocalContent(true)
.SetPageUri(url);
IPechkin pechkin = new Pechkin.Synchronized.SynchronizedPechkin(gc);
pdf = pechkin.Convert(oc);
【问题讨论】: