1
votes

i'm trying to create dynamic PDF's using ABCPdf and i'm having no success. I copied their sample code and tried it and i receive an error:

Unable to render HTML. No MSHTML document is available.

I'm trying to figure out how to use the Gecko engine to reder the page instead of IE and can't find how. Any help is greatly appreciated... thanks all!!!

damien

1

1 Answers

1
votes

Please see https://stackoverflow.com/a/11504285/1411950. This example uses the 1 rectangle for html->pdf output on each page. The rectangle is filled with raw html / html from url. It also can use Gecko engine. If you want to make dynamic pdf, you should use raw html for its content. Note, that it should be wrapped into something like

    const String HtmlWrapper = @"<!DOCTYPE html>
            <html>
                <head profile='http://www.w3.org/2005/10/profile'><title></title>
                    <meta http-equiv='Content-Type' content='text/html; charset=utf-8'>
                    <style type='text/css'>
                    </style>
                </head>
                <body>
                {0}
                </body>
            </html>";

where all css goes in script tags in the header or is referenced to