如何在pdfmake文本的初始部分添加制表空间

问题描述 投票:0回答:1

是否可以在pdfmake中的文本开头之前添加制表空间。我确实为此尝试了“\ t”,但是当我们将它添加到初始或字符串开始之前它不起作用。

这是我尝试的

var dd = {
>         content: [{
>     text: 'Cost',
>     style: 'header',
>     decoration: 'underline' }, {
>     text: '\tInvesting in a granulator is a wise move because of the enormous long-term savings of virgin raw materials and other benefits
> that you gain.',
>     style: 'para' }],
>         styles: {
>             header: {
>                 fontSize: 20,
>                 bold: true
>             },
>             para: {
>                 fontSize: 10,
>                 margin: [0, 9, 0, 9]             
>             }
> 
> }

目前我的输出是: -

成本

投资造粒是明智之举,因为原始材料的巨大长期储蓄和您获得的其他好处。

我正在寻找的是“投资造粒”之前的标签空间

javascript pdfmake
1个回答
2
投票

为标签空间效果的初始字符串添加多个“\ t”。

var dd = {
>         content: [{
>     text: 'Cost',
>     style: 'header',
>     decoration: 'underline' }, {
>     text: '\t\t\t Investing in a granulator is a wise move because of the enormous long-term savings of virgin raw materials and other benefits
> that you gain.',
>     style: 'para' }],
>         styles: {
>             header: {
>                 fontSize: 20,
>                 bold: true
>             },
>             para: {
>                 fontSize: 10,
>                 margin: [0, 9, 0, 9]             
>             }
> 
> }
© www.soinside.com 2019 - 2024. All rights reserved.