相关疑难解决方法(0)

如何使用fillColor填充pdfmake的列背景颜色?

有没有选项填充列背景颜色fillColor: '#dedede'fillColor非常适用于tablecell,同时它不适用于列:(

<script src="https://rawgit.com/bpampuch/pdfmake/master/build/vfs_fonts.js"></script>
<script src="https://rawgit.com/yelouafi/pdfmake/master/build/pdfmake.js"></script>
<script>
  function print(argument) {
    // open the PDF in a new window
    pdfMake.createPdf(docDefinition).open();
  }
</script>
<button onclick="print()" style="display:block; margin: 10px auto;padding: 20px 50px;">Print</button>
<hr>
<script>
  var docDefinition = {
    content: [
      'This paragraph fills full width, as there are no columns. Next paragraph however consists of three columns', {
        columns: [{
          // auto-sized columns have their widths based on their content
          width: 'auto',
          text: 'First column',
          fontSize: 30,
          fillColor: '#dedede' …
Run Code Online (Sandbox Code Playgroud)

javascript pdf pdf-generation pdfmake

4
推荐指数
2
解决办法
7618
查看次数

标签 统计

javascript ×1

pdf ×1

pdf-generation ×1

pdfmake ×1