0

到目前为止,我的 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 ignore 这删除了错误,但我的页脚没有加载

4

1 回答 1

0

我们在项目上有同样的问题。另外报告本地主机上的工作,但不在生产服务器上。问题的解决方法是添加路由,这样静态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/

之后一切正常。

于 2015-01-13T10:48:29.063 回答