How to solve "Qt: Failed to initialize OLE (error 80070005)"

I use Rotativa to create a PDF in my application. It works fine in my localhost (Development) application. I got "Qt: Failed to initialize OLE error (error 80070005)" once, I deployed to my server. How to solve this problem. thanks in advance

+4
source share
2 answers

Go to IIS> Site> Authentication, click on "ASP.NET Impersonation" and DISABLE it

+4
source

I found a problem here -

https://github.com/wkhtmltopdf/wkhtmltopdf/issues/2782

(css javascript) - html. IIS. , CSS. , Javascript, OLE. Javascript ( var x = 1;), .

wkhtmltopdf js ...

-

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).

ActionAsPdf UrlAsPdf

URL- localhost

string pthx = "http://localhost/Home/exmple?num=" + numtofind;
UrlAsPdf urlss = new UrlAsPdf(pthx) {
    FileName = "REPORT.pdf",
    CustomSwitches = "--print-media-type "
};

, wkhtmltopdf ...

, ...

0

Source: https://habr.com/ru/post/1652575/


All Articles