我只是想用RazorPDF创建一个简单的xml布局,但是我找不到任何方法来设置一些标记的背景色。
这就是我试过的
<paragraph style="background-color:red">
<chunk bgcolor="red">sampletext</chunk>
</paragraph>我的行动很简单,
public ActionResult Pdf()
{
return new PdfResult();
}发布于 2014-01-28 18:07:00
如果使用表格,则颜色“#808080”属性设置背景颜色,而style=“backgroundcolor=:blue”或red="0“green="0”blue="255“属性设置文本颜色。
<table width="100%" cellpadding="1.0" cellspacing="1.0">
<row>
<cell backgroundcolor="#FFFF00" borderwidth="0.5" left="true" right="true" top="true" bottom="true" size="12.0">
<chunk style="font-family:Times;font-weight:bold;font-size:9pt">
Customer
</chunk>
</cell>
<cell backgroundcolor="#FFFF00" borderwidth="0.5" left="true" right="true" top="true" bottom="true" size="12.0">
<chunk style="font-family:Times;font-weight:bold;font-size:9pt;color:blue">
Customer
</chunk>
</cell>
<cell backgroundcolor="#FFFF00" borderwidth="0.5" left="true" right="true" top="true" bottom="true" size="12.0">
<chunk red="0" green="0" blue="255" style="font-family:Times;font-weight:bold;font-size:9pt">
Customer
</chunk>
</cell>
</row></table>发布于 2014-01-22 01:24:09
<paragraph style="font-family:Helvetica;font-size:14; border:1px" align="center">
<chunk red="0" green="0" blue="255" >@ViewBag.Title</chunk>
</paragraph>https://stackoverflow.com/questions/18822713
复制相似问题