Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/csharp-4.0/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Asp.net mvc 4 Rotativa 1.6.1图像“;“鬼影”;但仅限于QA,而不是开发人员或集成服务器_Asp.net Mvc 4_C# 4.0_Wkhtmltopdf_Rotativa - Fatal编程技术网

Asp.net mvc 4 Rotativa 1.6.1图像“;“鬼影”;但仅限于QA,而不是开发人员或集成服务器

Asp.net mvc 4 Rotativa 1.6.1图像“;“鬼影”;但仅限于QA,而不是开发人员或集成服务器,asp.net-mvc-4,c#-4.0,wkhtmltopdf,rotativa,Asp.net Mvc 4,C# 4.0,Wkhtmltopdf,Rotativa,我正在运行一个c#MVC4应用程序,使用Rotativa将Razor视图转换为PDF。 Rotativa基本上是wkhtmltopdf的包装器 我升级到Rotativa 1.6.1,以修复wkhtmltopdf中的分页符问题,我的图像是“重影”。我回滚到1.5.0,问题就消失了(但是分页符又被破坏了) 看起来就像这个wkhtmltopodf bug一样 他们声称它固定在尖端。(我尝试手动更新到最新的稳定版本,但仍然发生) 奇怪的是,这个问题只发生在我们的QA服务器上,而不是我们的开发服务器,或

我正在运行一个c#MVC4应用程序,使用Rotativa将Razor视图转换为PDF。 Rotativa基本上是wkhtmltopdf的包装器

我升级到Rotativa 1.6.1,以修复wkhtmltopdf中的分页符问题,我的图像是“重影”。我回滚到1.5.0,问题就消失了(但是分页符又被破坏了)

看起来就像这个wkhtmltopodf bug一样

他们声称它固定在尖端。(我尝试手动更新到最新的稳定版本,但仍然发生)

奇怪的是,这个问题只发生在我们的QA服务器上,而不是我们的开发服务器,或者IT团队声称与QA“相同”的集成服务器上

你知道是什么导致了这个问题吗?还有人知道吗

本期: 这个呢

暗示存在一些可能导致Rotativa出现问题的权限问题。 有人能告诉我更多关于什么样的权限可能有问题的信息吗,这样我就可以在两个框中进行比较了

谢谢


Eric-

好的,我们找到了解决方法。。。这是“JPEG图像的重影”

所以我只是把它们从JPEG转换成PNG(两种已知的好图像格式之一)

因为它们已经以JPEG格式存储在数据库中,所以我在Razor视图中动态地进行了转换

有一些保真度的损失,但除此之外,它工作得很好

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" /> 
}
试试看
{
byte[]byteArrayIn=(byte[])@Model.ETA640StudentProfileVM[currentRecord].ImageObj;
字节[]byteArrayOut=null;
MemoryStream ms=新的MemoryStream(byteArrayIn,0,byteArrayIn.Length);
ms.Write(byteArrayIn,0,byteArrayIn.Length);
Image returnImage=Image.FromStream(ms,true);
使用(var output=newmemoryStream())
{
returnImage.Save(输出,System.Drawing.Imaging.ImageFormat.Png);
byteArrayOut=output.ToArray();
};
@:
}
抓住
{ 
@: 
}

wkhtmltopdf声称此错误已在tip中修复,但我们从他们的主机站点下载了“tip”exe,但没有修复此问题。这对我也很有效。代码窗口看起来有点凌乱,但它完成了任务!