Rotativa 1.6.1图片"重影"但仅限于QA,不dev的或集成服务器 [英] Rotativa 1.6.1 Image "ghosting" but only on QA, not dev or integration server

查看:154
本文介绍了Rotativa 1.6.1图片"重影"但仅限于QA,不dev的或集成服务器的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我运行一个C#MVC 4应用程序,使用Rotativa剃刀意见转换成PDF文件。
Rotativa基本上是围绕wkhtmltopdf的包装。

I'm running a c# MVC 4 app , using Rotativa to convert Razor views to Pdfs. Rotativa is basically a wrapper around wkhtmltopdf.

我升级到1.6.1 Rotativa在wkhtmltopdf修复分页符问题,,我的图像鬼影。我回滚到1.5.0和问题走了(但分页符再次被打破)。

I upgraded to Rotativa 1.6.1, to fix a page break issue in wkhtmltopdf,, and my images are "ghosting". I rolled back to 1.5.0 and the problem went away (but page breaks are broken again).

看起来就像在这个wkhtmltopodf错误
HTTP://$c$c.google.com/p / wkhtmltopdf /问题/细节?ID = 788

Looks just like in this wkhtmltopodf bug http://code.google.com/p/wkhtmltopdf/issues/detail?id=788

他们声称它是固定在一角。 (我试图手动更新到最新的稳定版本,它仍然发生)

They claim it's fixed in the tip. (I tried manually updating to the latest stable release and it still occurred)

奇怪的是只发生在我们的QA服务器,而不是我们的开发服务器,或者说,IT组织宣称我们的集成服务器上的问题是相同QA ...

Oddly the issue only occurs on our QA server, not our DEV server, or our integration server that the IT group claims is "identical" to QA...

任何想法可能会导致这个问题?任何人都得到它?

Any ideas what might be causing this issue? Anyone else getting it?

此问题:
https://github.com/webgio/Rotativa/issues/51
而这一次
https://github.com/webgio/Rotativa/issues/26

意味着有一些可能导致Rotativa有问题权限问题。
任何人都可以点我什么样的权限更多信息,可能是有过错的,这样我就可以在2盒再比较?

Imply there are some permission issues that can cause Rotativa to have problems. Can anyone point me to more information on what kind of permissions might be at fault, so I can compare then on the 2 boxes?

谢谢,

埃里克 -

推荐答案

确定我们周围想出了一个工作,这...这是鬼影为JPEG图像...

OK we figured out a work around for this... It's "ghosting for JPEG Images"...

所以我只是转换他们JPEG至PNG(2一种已知的良好形象格式)...

So I Just converted them from JPEG to PNG (one of 2 known good image formats)...

既然他们已经存储在数据库为JPEG,我做的剃刀查看飞的转换。

Since they were already stored in the DB as JPEG, I did the conversion on the fly in the Razor View.

有是保真的一些损失,但比它的伟大工程....其他

There is some loss of fidelity, but other than that it works great....

try
{
     byte [] byteArrayIn = ( byte[] )@Model.ETA640StudentProfileVM[ currentRecord ].ImageObj;
     byte[] byteArrayOut = null;

     MemoryStream ms = new MemoryStream( byteArrayIn, 0, byteArrayIn.Length );
     ms.Write( byteArrayIn, 0, byteArrayIn.Length );
     Image returnImage = Image.FromStream( ms, true );
     using (var output = new MemoryStream())
     {
         returnImage.Save( output, System.Drawing.Imaging.ImageFormat.Png );
         byteArrayOut = output.ToArray();
     };


     @:<img src="data:image/png;base64,@(Html.Raw( Convert.ToBase64String( byteArrayOut )))" alt="Image Not Available" height="155" />

}
catch
{ 
     @:<img src="" alt="Error Generating Image" height="155" /> 
}

这篇关于Rotativa 1.6.1图片&QUOT;重影&QUOT;但仅限于QA,不dev的或集成服务器的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆