如何在pdfmake文本的开头部分添加制表符空间

Akh*_*hil 1 javascript pdfmake

是否可以在 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]             
>             }
> 
> }
Run Code Online (Sandbox Code Playgroud)

目前我的输出是:-

成本

投资造粒是明智之举,因为可以长期节省大量原始原材料并获得其他好处。

我正在寻找的是“投资颗粒化”之前的制表符空间

小智 5

试试这个\u200B\t,它是一个零宽度的空格,后面跟着一个制表符。

其他解决方案可以在这里找到:https ://github.com/bpampuch/pdfmake/issues/1566