Search code examples
imageabcpdf

ABCPDF cutting off image


I had a problem with ABCPDF not rendering my image in PDF from the HTML I had. I was able to get an image to partially render by setting height/width properties on the image element. Now the problem is that the image is not showing in PDF as full. Rather it's showing up as a thin long line which is equal to it's height but the width is only 3 px. The image height/width were 380/680. I have set Render delay of 3000 in my code to facilitate loading of image completely but that didn't help either.

Any suggestions?

Thanks


Solution

  • I figured this out. The problem wasn't with my code or height/width settings. Rather, it was the browser engine that ABCPDF uses by default - MSHTML. I set the engine to be Gecko and it all worked. You need to add this to your code

    doc.HtmlOptions.Engine = EngineType.Gecko;

    Good luck programming!