I am using Rotativa to generate PDF in my Application. It's working fine in my application localhost (Development). I got the "Qt: Could not initialize OLE (error 80070005)" error once, i have deployed in my server. How to solve this issue. Thanks advance
Go to IIS > Site > Authentication, click on "ASP.NET Impersonation" and DISABLE it
I found the problem here-
https://github.com/wkhtmltopdf/wkhtmltopdf/issues/2782
We started by removing all assets (css and javascript) from the document - leaving just images and the html layout. It generated correctly through IIS. We then slowly added back resources, starting with CSS. The moment we added one of our Javascript files back it threw the OLE error again. We removed that and added some simple Javascript to the document (literally var x = 1;) and it still failed.
For some reson wkhtmltopdf cannot find js files...
so i found the solution here-
https://github.com/wkhtmltopdf/wkhtmltopdf/issues/1634
I simply had to change:
<script src="//cdnjs.cloudflare.com/ajax/libs/numeral.js/1.4.5/numeral.min.js"></script>
to:
<script src="http://cdnjs.cloudflare.com/ajax/libs/numeral.js/1.4.5/numeral.min.js"></script>
(added the HTTP).
I also switch on server from ActionAsPdf to UrlAsPdf
And set the url to localhost
string pthx = "http://localhost/Home/exmple?num=" + numtofind;
UrlAsPdf urlss = new UrlAsPdf(pthx) {
FileName = "REPORT.pdf",
CustomSwitches = "--print-media-type "
};
I think the wkhtmltopdf can't find host...
Hope it will help you too...
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With