test_context2d_paths.html 935 B

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  1. <!doctype html>
  2. <!--
  3. /**
  4. * jsPDF Context2d PlugIn
  5. * Copyright (c) 2014 Steven Spungin (TwelveTone LLC) steven@twelvetone.tv
  6. *
  7. * Licensed under the MIT License.
  8. * http://opensource.org/licenses/mit-license
  9. */
  10. -->
  11. <html>
  12. <head>
  13. <meta http-equiv="content-type" content="text/html; charset=UTF-8">
  14. <title>Context2D Paths Test</title>
  15. </head>
  16. <body style='background-color: silver; margin: 0;'>
  17. <script src="../../dist/jspdf.min.js"></script>
  18. <script src="../../examples/js/test_harness.js"></script>
  19. <script>
  20. var pdf = new jsPDF('p', 'pt', 'letter');
  21. var context = pdf.context2d;
  22. context.beginPath();
  23. context.arc(150,150,50,0,Math.PI, false);
  24. context.lineTo(300,300);
  25. //context.moveTo(300,150);
  26. //context.rect(5,5,150,150);
  27. //context.arc(150,150,50,0,Math.PI, false);
  28. context.stroke();
  29. context.fillStyle = 'red';
  30. context.fillRect(545,205,50,40);
  31. pdf_test_harness_init(pdf);
  32. </script>
  33. </head>
  34. </body>
  35. </html>