我试图从剃刀意见中制作 Pdf。但它总是让我出错。我使用过 Visual Studio 2013、.net 框架 4.5 和 asp.net mvc5。
为了创建,我曾经安装过 RazorPdf 版本 1.0.0.0 包和 itextsharp 5.5.2.0 版本。
代码快照----------
//controller code
public PdfResult Pdf()
{
return new PdfResult();
}
//razor view
@{
Layout = null;
}
<itext creationdate="@DateTime.Now.ToString()" producer="RazorPDF">
<table width="100%" cellpadding="0.5" cellspacing="0.5" widths="30;70" borderwidth="1.0" left="false" right="false" top="false" bottom="false" red="0" green="0" blue="0">
<row>
<cell>
<chunk style="font-weight:bold;">Today:</chunk>
</cell>
<cell>
<chunk style="">@DateTime.Now.ToString("MM/dd/yyyy")</chunk>
</cell>
</row>
<row>
<cell>
<chunk style="font-weight:bold;">Yesterday:</chunk>
</cell>
<cell>
<chunk style="">@DateTime.Now.AddDays(-1).ToString("MM/dd/yyyy")</chunk>
</cell>
</row>
</table>
- - - - - - - - - - - 错误详情 - - - - - - - -
无法从程序集“itextsharp,版本=5.5.2.0,文化=中性,PublicKeyToken=8354ae6d2174ddca”加载类型“iTextSharp.text.html.HtmlParser”