@@ -342,6 +342,23 @@ <h2></h2>
342
342
</ pre >
343
343
< button onclick ="javascript:demoFromHTML() " class ="button "> Run Code</ button > </ p > </ div > </ div >
344
344
345
+
346
+ < h2 > < a href ="# "> Text alignment</ a > </ h2 >
347
+ < div > < p > < pre > var pdf = new jsPDF('p', 'pt', 'letter');
348
+
349
+ pdf.text( 'This text is centered\raround\rthis point.', 150, 50, 'center' );
350
+ pdf.text( 'This text is centered\raround\rthis point.', 150, 300, 45, 'center' );
351
+ pdf.text( 'This text is\raligned to the\rright.', 150, 400, 'right' );
352
+ pdf.text( 'This text is\raligned to the\rright.', 150, 550, 45, 'right' );
353
+
354
+ pdf.text( 'This text is centered\raround\rthis point.', 400, 50, 'center' );
355
+ pdf.text( 'This text is centered\raround\rthis point.', 400, 150, -85, 'center' );
356
+ pdf.text( 'This text is\raligned to the\rright.', 400, 400, 'right' );
357
+ pdf.text( 'This text is\raligned to the\rright.', 400, 550, -85, 'right' );
358
+
359
+ pdf.save('Test.pdf');</ pre >
360
+ < a href ="javascript:demoTextAlign() " class ="button "> Run Code</ a > </ p > </ div >
361
+
345
362
</ div >
346
363
</ div >
347
364
0 commit comments