Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/node.js/34.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Node.js 节点pdfkit文本宽度_Node.js_Node Pdfkit - Fatal编程技术网

Node.js 节点pdfkit文本宽度

Node.js 节点pdfkit文本宽度,node.js,node-pdfkit,Node.js,Node Pdfkit,我正在尝试使用node的pdfkit制作PDF,但遇到了一些与文本宽度相关的问题 我想要的结果是这样的 Overall comments: This is the comment that will display here bla bla extra text here 但我现在的代码是这样的 Overall comments:

我正在尝试使用node的pdfkit制作PDF,但遇到了一些与文本宽度相关的问题

我想要的结果是这样的

Overall comments:              This is the comment 
                               that will display here bla bla
                               extra text here 
但我现在的代码是这样的

Overall comments:              This is the comment
that will display here blab bla extra text here
要编写这段文字,我使用以下代码:

doc.font('Courier-Bold').text(padRight('Overall Comments:',28),{continued: true});
doc.font('Courier').text(audit.comment,{width: 100,align: 'justify'});
其中audit.comment是右侧的文本,padRight返回固定大小为28的字符串,并在右侧添加空格


似乎它忽略了宽度选项,或者我不知道如何使用它。

您找到了该问题的答案吗?