我在我的React应用程序中使用npm jspdf 2.3.1。
一切工作正常。我想将文本对齐,但起始点应该是“右侧”。
const [state, setState] = useState({
doc: new jsPDF(),
});
const myPdf = ( ) => {
state.doc.addFileToVFS("MyFont.ttf", myFont); // Arabic Font
state.doc.addFont("MyFont.ttf", "MyFont", "normal");
state.doc.text(
"لوريم إيبسوم هو ببساطة نص شكلي (بمعنى أن الغاية هي الشكل وليس",
190,
10,
"right"
);
state.doc.save();
}
我的尝试是这样的
state.doc.text(
"لوريم إيبسوم هو ببساطة نص شكلي (بمعنى أن الغاية هي الشكل وليس",
190, //it prints left to right
10,
{ maxWidth: 250, align: "justify" } //it's not justifying the text
);
我是不是做错了,还是需要使用插件?如果可以,我该如何同时保留“对齐到右侧”和“两端对齐”?
text-align: justify;
- Zahir Masoodi