首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >RazorPDF -如何为单元格、段落等标签设置背景色

RazorPDF -如何为单元格、段落等标签设置背景色
EN

Stack Overflow用户
提问于 2013-09-16 15:42:02
回答 2查看 1.3K关注 0票数 0

我只是想用RazorPDF创建一个简单的xml布局,但是我找不到任何方法来设置一些标记的背景色。

这就是我试过的

代码语言:javascript
复制
<paragraph style="background-color:red">
   <chunk bgcolor="red">sampletext</chunk>
</paragraph>

我的行动很简单,

代码语言:javascript
复制
public ActionResult Pdf() 
{
     return new PdfResult();
}
EN

回答 2

Stack Overflow用户

发布于 2014-01-28 18:07:00

如果使用表格,则颜色“#808080”属性设置背景颜色,而style=“backgroundcolor=:blue”或red="0“green="0”blue="255“属性设置文本颜色。

代码语言:javascript
复制
<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>
票数 3
EN

Stack Overflow用户

发布于 2014-01-22 01:24:09

代码语言:javascript
复制
    <paragraph  style="font-family:Helvetica;font-size:14; border:1px" align="center">
        <chunk red="0" green="0" blue="255" >@ViewBag.Title</chunk>
    </paragraph>
票数 -1
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/18822713

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档