我正在努力实现左右两侧在同一行上有两个文本。预期结果的图像如下所示
我尝试做以下但结果不正确
doc.font('Bold').text("My long company name in english", { align: 'left', width: 195, continued: true }).text(" ", {width: 100, continued: true}).text("My long company name in arabic", {width: 195, align: "right"});
doc
.font('Helvetica')
.fontSize(16)
.text(`LEFT`, {continued:true})
.text(`RIGHT`, {
align: 'right'
}).moveDown()
doc
.font('Helvetica')
.fontSize(16)
.text(`LEFTs`, {continued:true, align: 'left'})
.text(`middle`, {continued:true, align: 'center'})
.text(`RIGHT`, {
align: 'right'
});
doc.end()
你应该在第一次和第二次对齐时使用属性 continued true(不需要最后一项)