Saturday, April 21, 2012

ABCpdf stopped working after IE9 is installed

Hi All,

We use ABCPDF to generate PDF out of a SharePoint data. The version we use is 8.0.0.5. Till now, everything worked fine and suddenly, ABCPDF stopped working with the below error message:

"ABCpdf could not initiate MSHtml engine for this version of Internet Explorer installed."

The only change done to the server was that IE9 is installed. According to the WebSuperGoo support team, ABCPDF versions below 8.1 do not support IE9. The below is the explanation:

Using IE9 on the same system as older ABCpdf versions may cause this error message. The current release - ABCpdf 8.1 - is fully compatible with IE9 and also provides a new Gecko-based HTML engine.

When converting HTML to PDF, ABCpdf uses the MSHTML component installed with Internet Explorer as the first stage of the process. The issue when using older ABCpdf versions is related to a set of problems Microsoft introduced in IE9. We (and other developers) reported these issues to Microsoft in September 2010 but unfortunately they have not been fixed.

Unfortunately with the official release of IE9 Microsoft released new documentation which says the IHTMLElementRender::DrawToDC function that was required has been deprecated. This is especially unfortunate given that there is no replacement for this function.

Given that Microsoft appears to be unwilling to support these interfaces we would strongly recommend that on new deployments you consider a move to the new Gecko-based HTML engine available in ABCpdf 8. It is just one line of code to select the Gecko rendering engine (see the Doc.HtmlOptions.Engine property).

WorkAround:

Change the Rendering Engine from MSHtml to Gecko by using the below code:
Doc theDoc = new Doc();
theDoc.HtmlOptions.Engine = EngineType.Gecko;
After this issue is resolved, we got one more error which says "The RPC server is unavailable"

2 comments:

  1. Hello-

    My company uses ABCPdf through PHP via COM. I know most people using ABCPdf are likely doing so through VB or C#... I am attempting to set the rendering engine to Gecko but having difficulty (see code sample below)... Can anybody assist with this task?

    Thanks,
    -Andrew

    $oPDFDoc=new COM("ABCpdf8.Doc");
    $oPDFDoc->SetInfo(-1, "/Info*/Title:Text", "Sample Document");
    //Attempted to add this line but having difficulty - should I use a constant instead of 'Gecko'? if so, what is that constant value?
    $oPDFDoc->HtmlOptions->Engine = 'Gecko';

    ReplyDelete
  2. Do we have this option in ABCPDF6 ?

    ReplyDelete