html-pdf 文本对齐:证明不起作用?



我在 Node 中使用 html-pdf .js将 html 文本转换为 pdf。 文本对齐:左对齐、居中和右对齐。但是文本对齐:对齐不起作用。当文本对齐对齐时,它会导出左对齐的文本。

这是 HTML 代码:

<p class="ql-align-justify"><span style="background-color: rgb(255, 255, 255);">Hello, this is some text. Hello, this is some text. Hello, this is some text. Hello, this is some text. Hello, this is some text. Hello, this is some text. Hello, this is some text. Hello, this is some text. </span></p>

这是 CSS 代码:

.ql-align-justify {
text-align: justify;
}

如何使文本对齐:证明工作?

看来您需要将 WIDTH 设置为您的范围,这将有所帮助。

最新更新