0

I am using ABCPDF 8 for .NET to generate PDF.

Doc theDoc = new Doc();
theDoc.HtmlOptions.Engine = EngineType.Gecko;
theDoc.HtmlOptions.UseScript = true;            
theDoc.Rect.Inset(20, 20);
int theID = theDoc.AddImageHtml(html, true, 600, true);

The PDF generates fine. Although I added google charts to the page:

<script type="text/javascript" src="https://www.google.com/jsapi"></script>
    <script type="text/javascript">
        google.load("visualization", "1.0", { packages: ["corechart"] });
    </script>

Now PDF generation hangs on AddImageHtml method. Note that the HTML itself (with charts) is displayed fine in the browser.

4

1 回答 1

0

渲染页面时默认禁用 Javascript(当然,Google Charts 需要执行任何操作)。请参阅UseScript 属性。您可能还需要或想要使用Engine 属性将引擎设置为 Gecko 以获得更准确的渲染。

于 2013-10-02T14:20:52.203 回答