webgio / Rotativa

Rotativa, /rota'tiva/. Make Pdf from Asp.Net MVC. Available on Nuget https://www.nuget.org/packages/Rotativa
http://letsfollowtheyellowbrickroad.blogspot.it/search/label/Rotativa
MIT License
622 stars 220 forks source link

QPaintDevice: Cannot destroy paint device that is being painted #133

Closed ilqar008 closed 8 years ago

ilqar008 commented 8 years ago

Hello, i have an app generates pdf from html. But after i added header as in below, it gives such an error as saying that "QPaintDevice: Cannot destroy paint device that is being painted".

Could you help me to solve this issue, please? Thanks ` string customSwitches = string.Format("--load-error-handling ignore --allow {0} --header-html {0} --header-spacing 4 ", Url.Action("Header", "Print", new { area = "", number }, "http"));

   [AllowAnonymous]
    public ActionResult Header(string number)
    {
        string content = @"<!DOCTYPE html><html><head><style>body {text-align: center; }</style></head><body> № " + number + ", date: " + DateTime.Now.ToShortDateString() + "</body></html>";
        return Content(content);
    }`
ilqar008 commented 8 years ago

I solved the issue by changing the customswitches as string customSwitches = string.Format("--header-html {0} --header-spacing 4 ", " http://localhost:portnumber/Print/Header?number="+number);

glautrou commented 4 years ago

My issue was because the footer returned 404. More details on this issue.