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

标签 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]             
>             }
> 
> }

目前我的输出是:-

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/

相关文章:

javascript - 在 DOM 中构建全局变量

pdfmake - 如何动态检查 PDFMake 中的剩余页面高度?

html - DataTable JQuery 导出 PDF 显示错误方向的阿拉伯数据

javascript - PdfMake 要重复的项目列表(文本旁边的复选框)

javascript - 使用两个或多个具有不同数量属性的着色器时发生冲突

javascript - 如何将这些确切的创建/读取 cookie 函数转换为本地存储?

javascript - 在正确的输入上使用 js 重新启用提交按钮

javascript - Internet Explorer 8 中的 HTML5 和 CSS3 功能

node.js - 使用 Promise 在 Node.js 中将多个 svg 字符串流式传输到 png

javascript - pdfmake 从长 HTML 表生成 PDF