score:1

doc.text(['لا إله إلا الله محمد رسول الله', 'لا إله إلا الله', 'a'], 100, 100, { lang: 'ar' });

score:1

const input = document.getElementById('divIdToPrint');    
html2canvas(input)
      .then((canvas) => {
        const imgData = canvas.toDataURL('image/png');
        const pdf = new jsPDF();
        pdf.addImage(imgData, 'PNG', 0, 0);
        pdf.save("download.pdf");  
  });

score:3

doc.text("Arabic Text", 200, 20, "right");
//OR
doc.text("Arabic Text", 200, 20, { align : "right" } ); 
/* 
200 is the x coordinate and marks the starting position of the text from right.
y coordinate is the distance from the top of the page.
*/

Related Query

More Query from same tag