Rotativa - QT未经测试的版本

时间:2015-01-06 11:09:41

标签: asp.net-mvc wkhtmltopdf rotativa

到目前为止,我的Rorativa(最新的稳定版本 - 1.6.1)在我的MVC项目中表现非常出色。

我的代码最初是

return new Rotativa.ActionAsPdf(string.Format("PrintPage/{0}", id));

我得到了一个很好的pdf版本的页面

但是现在我想做更多进步的东西,所以我这样做

return new Rotativa.ActionAsPdf(string.Format("PrintPage/{0}", id))
        {
            CustomSwitches = "--print-media-type --footer-html " + Url.Action("Footer",id)
        };

然后当我这样做时出现此错误

Qt: Untested Windows version 6.2 detected!
QMetaObject::invokeMethod: No such method WebCore::SocketStreamHandlePrivate::socketSentData()
Error: Failed loading page http:///Invoice/Footer?page=1&section=Account Queries      VAT No.    
0&title=Ben Dover-Invoice No: 
A0120852&subsection=MATERIALS&frompage=1&subsubsection=&topage=2&doctitle=Ben Dover-Invoice No: 
A0120852&webpage=http://localhost:2066/Invoice/PrintPage/386&time=01:01:59 PM&date=2015/01/06 
(sometimes it will work just to ignore this error with --load-error-handling ignore)
Error: Failed loading page http:///Invoice/Footer?page=2&section=Account Queries      VAT No.   
0&title=Ben Dover-Invoice No: A0120852&subsection=TOTAL R   
1á850.70&frompage=1&subsubsection=&topage=2&doctitle=Ben Dover-Invoice No:   
A0120852&webpage=http://localhost:2066/Invoice/PrintPage/386&time=01:01:59 PM&date=2015/01/06     
(sometimes it will work just to ignore this error with --load-error-handling ignore)
QPaintDevice: Cannot destroy paint device that is being painted
pure virtual method called

This application has requested the Runtime to terminate it in an unusual way.
Please contact the application's support team for more information.
terminate called without an active exception

我尝试按照建议添加--load-error-handling忽略这会删除错误,但我的页脚没有加载

1 个答案:

答案 0 :(得分:0)

我们在项目上遇到同样的问题。另外报告localhost但不在生产服务器上工作。该问题的解决方案是添加路由,因此静态IP地址将在服务器上表示为本地。

http://technet.microsoft.com/en-us/library/cc757323%28v=ws.10%29.aspx

在某些因某些原因无法添加的服务器上,我们添加Microsoft环回适配器来执行相同的操作。

https://4sysops.com/archives/how-to-install-loopback-adapter-in-windows-8/

之后一切都很完美。