是否可以在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]
> }
>
> }
目前我的输出是:-
Cost
Investing in a granulation is a wise move because of the enormous long-term savings of virgin raw materials and other benefits that you gain.
我正在寻找的是“投资颗粒化”之前的制表符空间
最佳答案
试试这个\u200B\t
,它是 zero width space随后是一个选项卡。
其他解决方案可以在这里找到:https://github.com/bpampuch/pdfmake/issues/1566
关于javascript - 如何在pdfmake文本的开头部分添加制表符空间,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/33995345/