@@ -351,3 +351,28 @@ function demoFromHTML() {
351
351
margins
352
352
)
353
353
}
354
+
355
+ function demoTextAngles ( ) {
356
+ var pdf = new jsPDF ( 'p' , 'pt' , 'letter' ) ;
357
+
358
+ pdf . text ( 'This text is at angle 0' , 150 , 50 , 0 ) ;
359
+ pdf . text ( 'This text is at angle 45' , 150 , 300 , 45 ) ;
360
+ pdf . text ( 'This text is at angle 90' , 150 , 600 , 90 ) ;
361
+ pdf . save ( 'Test.pdf' ) ;
362
+ }
363
+
364
+ function demoTextAlign ( ) {
365
+ var pdf = new jsPDF ( 'p' , 'pt' , 'letter' ) ;
366
+
367
+ pdf . text ( 'This text is centered\raround\rthis point.' , 150 , 50 , 'center' ) ;
368
+ pdf . text ( 'This text is centered\raround\rthis point.' , 150 , 300 , 45 , 'center' ) ;
369
+ pdf . text ( 'This text is\raligned to the\rright.' , 150 , 400 , 'right' ) ;
370
+ pdf . text ( 'This text is\raligned to the\rright.' , 150 , 550 , 45 , 'right' ) ;
371
+
372
+ pdf . text ( 'This text is centered\raround\rthis point.' , 400 , 50 , 'center' ) ;
373
+ pdf . text ( 'This text is centered\raround\rthis point.' , 400 , 150 , - 85 , 'center' ) ;
374
+ pdf . text ( 'This text is\raligned to the\rright.' , 400 , 400 , 'right' ) ;
375
+ pdf . text ( 'This text is\raligned to the\rright.' , 400 , 550 , - 85 , 'right' ) ;
376
+
377
+ pdf . save ( 'Test.pdf' ) ;
378
+ }
0 commit comments