Warning: file_get_contents(/data/phpspider/zhask/data//catemap/4/postgresql/10.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
Phantomjs 转换后不显示html到pdf ASP.NET.Core 1.1图像_Phantomjs_Html To Pdf_Asp.net Core 1.1 - Fatal编程技术网

Phantomjs 转换后不显示html到pdf ASP.NET.Core 1.1图像

Phantomjs 转换后不显示html到pdf ASP.NET.Core 1.1图像,phantomjs,html-to-pdf,asp.net-core-1.1,Phantomjs,Html To Pdf,Asp.net Core 1.1,我正在使用html转换为pdf。一切都正常,但在添加标记时,它并没有显示我想要的PDF格式的图像。比如说, string image = "~/images/test.png"; string htmlToConvert = string.Format(@" <div> <table> <tr> <td> <img srcset='{0}'>

我正在使用html转换为pdf。一切都正常,但在添加
标记时,它并没有显示我想要的PDF格式的图像。比如说,

string image = "~/images/test.png";
string htmlToConvert = string.Format(@"
<div>
    <table>     
        <tr>
            <td>
                <img srcset='{0}'>
            </td>
        </tr>        
    </table>
</div>", image);
string image=“~/images/test.png”;
字符串htmlToConvert=string.Format(@)
“,图像);
我的格式有什么问题吗?或者只是不支持图像?如果是真的,asp.net core 1.1是否有可用的库?(很重要,因为有些库/建议基于包含project.json文件的1.0)


p、 我将通过Azure web app服务部署它

映像必须与phantomjs Executabel所在的文件夹位于同一文件夹中

请看一下这个方法 PdfGenerator.writehtmlottempfile

在那里,您可以看到html存储在phantomjs安装目录中的一个文件中。这是html文件的根,这意味着图像也必须在那里


我建议您直接使用phantomjs Executabel来更好地了解正在发生的事情。

解决了这个问题
srcset
也需要更改为
src
,这就解决了这个问题。谢谢你,艾德瓦尔德。