本文介绍了ItextSharp - RazorPdf将图像放在Pdf上的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
如何将图像放在itextSharp生成的pdf上?
How can I put an image on the itextSharp generated pdf?
我在控制器上有一个简单的方法......
I have a simple method at the controller...
public ActionResult Pdf()
{
var pdfResult = new PdfResult(null,"Pdf");
pdfResult.ViewBag.Title = "Title";
return pdfResult;
}
一个简单的视图......
And a simple view...
@{
Layout = null;
}
<itext creationdate="@DateTime.Now.ToString()" producer="RazorPDF">
Html Text for test.
<img src="~/Images/sampleImage.png" />
</itext>
任何帮助都将不胜感激!
Any help would be appreciated!
推荐答案
尝试:
< image url =@ Context.Server.MapPath(〜/ Images /sampleImage.png)/>
并查看
这篇关于ItextSharp - RazorPdf将图像放在Pdf上的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!