简体   繁体   English

我无法在HTML生成的PDF中渲染图片

[英]I can't render pictures in an HTML generated PDF

I got an issu with the plugin IronPDF. 我的插件IronPDF发行了issu。 I'm trying to render HTML and CSS display to a PDF files, it work in our web application, but now I'm trying to do the same stuff with a windows service. 我正在尝试将HTML和CSS显示呈现为PDF文件,它可以在我们的Web应用程序中使用,但是现在我试图使用Windows服务来做同样的事情。 I tried to use Bootstrap locally to get CSS, that didn't work so I used CDN link and it worked. 我尝试在本地使用Bootstrap来获取CSS,但该方法不起作用,因此我使用了CDN链接,并且该方法有效。 But now, I would like to use pictures, so I pasted a folder in the root of the project with pictures in it, I think it's an application root problem (Ibelieved that the application root was the root of the project, but it seems to be wrong) 但是现在,我想使用图片,所以我在项目的根目录中粘贴了一个文件夹,其中包含图片,我认为这是应用程序的根目录问题(我相信应用程序的根目录是项目的根目录,但似乎是错的)

I would like to have something like this: 我想要这样的东西:

https://prnt.sc/gvzvpg https://prnt.sc/gvzvpg

but instead, I have something like that : 但是相反,我有这样的东西:

http://prntscr.com/gvzw1r http://prntscr.com/gvzw1r

thanks for attention 感谢您的关注

I used before ItexSharp for generating PDF files with c#. 我在ItexSharp之前使用c#生成PDF文件。 For images, the path must be relative path. 对于图像,该路径必须是相对路径。 try it 试试吧

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM