Tuesday, February 11, 2014

abcPDF

Here is an interesting problem when using abcPDF Gecko engine.

Error creating initial PDF: WebSupergoo.ABCpdf9.Internal.PDFException: Failed to add HTML: Page load timed out.; Gecko engine hit an error it was unable to recover from. Possible causes: XULRunner folder is corrupt or is from another version of ABCpdf. ---> WebSupergoo.ABCpdf9.Internal.PDFException: Gecko engine hit an error it was unable to recover from. Possible causes: XULRunner folder is corrupt or is from another version of ABCpdf. at WebSupergoo.ABCpdf9.Internal.Gecko.GeckoWorker.AddImageUrl(String url, Double pageWidthMm, Double pageHeightMm, AddImageUrlOptions options, UInt32& numCommands, Byte[]& data) --- End of inner exception stack trace ---


This took a while to track down. It is a combo of two things. One, if the page that you are rendering has something like this one it:

$(document).ready(function () { window.print(); });

And, your abcPDF Gecko MediaType is Screen. Regardless of your UseScript setting.

Now the document also refer to an error in another condition as well. Wouldn't it be awesome if they would give you the exception that will be thrown?

"For the Gecko engine, the Screen media must be used with UseScript true. An invalid combination (i.e. Screen with UseScript false) yields an exception when you call AddImageUrl or AddImageHtml."

I must also say, I have been a huge fan of WebSupergoo for a long time. I have programmed a lot of heavy duty PDF magic with their product. Also, I have been a fan of their support. But, I have to say their support is getting slow to respond and unhelpful.

No comments:

Post a Comment