12
12
13
13
/** @preserve
14
14
* jsPDF - PDF Document creation from JavaScript
15
- * Version 1.3.0 Built on 2016-09-28T10:52:40.410Z
16
- * CommitID a434267220
15
+ * Version 1.3.0 Built on 2016-09-28T17:23:20.924Z
16
+ * CommitID c01f6b51de
17
17
*
18
18
* Copyright (c) 2010-2014 James Hall <
[email protected] >, https://github.com/MrRio/jsPDF
19
19
* 2010 Aaron Spike, https://github.com/acspike
2026
2026
* pdfdoc.mymethod() // <- !!!!!!
2027
2027
*/
2028
2028
jsPDF.API = { events: [] };
2029
- jsPDF.version = "1.3.0 2016-09-28T10:52:40.410Z :jameshall";
2029
+ jsPDF.version = "1.3.0 2016-09-28T17:23:20.924Z :jameshall";
2030
2030
2031
2031
if (typeof define === 'function' && define.amd) {
2032
2032
define('jsPDF', function () {
@@ -2588,25 +2588,51 @@ Q\n";
2588
2588
var DotRadius = AcroForm.Appearance.internal.getWidth(formObject) <= AcroForm.Appearance.internal.getHeight(formObject) ? AcroForm.Appearance.internal.getWidth(formObject) / 4 : AcroForm.Appearance.internal.getHeight(formObject) / 4;
2589
2589
// The Borderpadding...
2590
2590
DotRadius *= 0.9;
2591
- var c = AcroForm.Appearance.internal.Bezier_C;
2591
+ // Save results for later use; no need to waste processor ticks on doing math
2592
+ var k = DotRadius * 2;
2593
+ // var c = AcroForm.Appearance.internal.Bezier_C;
2594
+ var kc = k * AcroForm.Appearance.internal.Bezier_C;
2595
+ var dc = DotRadius * AcroForm.Appearance.internal.Bezier_C;
2596
+ // stream += "0.749023 g\n\
2597
+ // q\n\
2598
+ // 1 0 0 1 " + AcroForm.Appearance.internal.getWidth(formObject) / 2 + " " + AcroForm.Appearance.internal.getHeight(formObject) / 2 + " cm\n\
2599
+ // " + DotRadius * 2 + " 0 m\n\
2600
+ // " + DotRadius * 2 + " " + DotRadius * 2 * c + " " + DotRadius * 2 * c + " " + DotRadius * 2 + " 0 " + DotRadius * 2 + " c\n\
2601
+ // -" + DotRadius * 2 * c + " " + DotRadius * 2 + " -" + DotRadius * 2 + " " + DotRadius * 2 * c + " -" + DotRadius * 2 + " 0 c\n\
2602
+ // -" + DotRadius * 2 + " -" + DotRadius * 2 * c + " -" + DotRadius * 2 * c + " -" + DotRadius * 2 + " 0 -" + DotRadius * 2 + " c\n\
2603
+ // " + DotRadius * 2 * c + " -" + DotRadius * 2 + " " + DotRadius * 2 + " -" + DotRadius * 2 * c + " " + DotRadius * 2 + " 0 c\n\
2604
+ // f\n\
2605
+ // Q\n\
2606
+ // 0 g\n\
2607
+ // q\n\
2608
+ // 1 0 0 1 " + AcroForm.Appearance.internal.getWidth(formObject) / 2 + " " + AcroForm.Appearance.internal.getHeight(formObject) / 2 + " cm\n\
2609
+ // " + DotRadius + " 0 m\n\
2610
+ // " + DotRadius + " " + DotRadius * c + " " + DotRadius * c + " " + DotRadius + " 0 " + DotRadius + " c\n\
2611
+ // -" + DotRadius * c + " " + DotRadius + " -" + DotRadius + " " + DotRadius * c + " -" + DotRadius + " 0 c\n\
2612
+ // -" + DotRadius + " -" + DotRadius * c + " -" + DotRadius * c + " -" + DotRadius + " 0 -" + DotRadius + " c\n\
2613
+ // " + DotRadius * c + " -" + DotRadius + " " + DotRadius + " -" + DotRadius * c + " " + DotRadius + " 0 c\n\
2614
+ // f\n\
2615
+ // Q\n";
2616
+
2617
+ // FASTER VERSION with less processor ticks spent on math operations
2592
2618
stream += "0.749023 g\n\
2593
2619
q\n\
2594
2620
1 0 0 1 " + AcroForm.Appearance.internal.getWidth(formObject) / 2 + " " + AcroForm.Appearance.internal.getHeight(formObject) / 2 + " cm\n\
2595
- " + DotRadius * 2 + " 0 m\n\
2596
- " + DotRadius * 2 + " " + DotRadius * 2 * c + " " + DotRadius * 2 * c + " " + DotRadius * 2 + " 0 " + DotRadius * 2 + " c\n\
2597
- -" + DotRadius * 2 * c + " " + DotRadius * 2 + " -" + DotRadius * 2 + " " + DotRadius * 2 * c + " -" + DotRadius * 2 + " 0 c\n\
2598
- -" + DotRadius * 2 + " -" + DotRadius * 2 * c + " -" + DotRadius * 2 * c + " -" + DotRadius * 2 + " 0 -" + DotRadius * 2 + " c\n\
2599
- " + DotRadius * 2 * c + " -" + DotRadius * 2 + " " + DotRadius * 2 + " -" + DotRadius * 2 * c + " " + DotRadius * 2 + " 0 c\n\
2621
+ " + k + " 0 m\n\
2622
+ " + k + " " + kc + " " + kc + " " + k + " 0 " + k + " c\n\
2623
+ -" + kc + " " + k + " -" + k + " " + kc + " -" + k + " 0 c\n\
2624
+ -" + k + " -" + kc + " -" + kc + " -" + k + " 0 -" + k + " c\n\
2625
+ " + kc + " -" + k + " " + k + " -" + kc + " " + k + " 0 c\n\
2600
2626
f\n\
2601
2627
Q\n\
2602
2628
0 g\n\
2603
2629
q\n\
2604
2630
1 0 0 1 " + AcroForm.Appearance.internal.getWidth(formObject) / 2 + " " + AcroForm.Appearance.internal.getHeight(formObject) / 2 + " cm\n\
2605
2631
" + DotRadius + " 0 m\n\
2606
- " + DotRadius + " " + DotRadius * c + " " + DotRadius * c + " " + DotRadius + " 0 " + DotRadius + " c\n\
2607
- -" + DotRadius * c + " " + DotRadius + " -" + DotRadius + " " + DotRadius * c + " -" + DotRadius + " 0 c\n\
2608
- -" + DotRadius + " -" + DotRadius * c + " -" + DotRadius * c + " -" + DotRadius + " 0 -" + DotRadius + " c\n\
2609
- " + DotRadius * c + " -" + DotRadius + " " + DotRadius + " -" + DotRadius * c + " " + DotRadius + " 0 c\n\
2632
+ " + DotRadius + " " + dc + " " + dc + " " + DotRadius + " 0 " + DotRadius + " c\n\
2633
+ -" + dc + " " + DotRadius + " -" + DotRadius + " " + dc + " -" + DotRadius + " 0 c\n\
2634
+ -" + DotRadius + " -" + dc + " -" + dc + " -" + DotRadius + " 0 -" + DotRadius + " c\n\
2635
+ " + dc + " -" + DotRadius + " " + DotRadius + " -" + dc + " " + DotRadius + " 0 c\n\
2610
2636
f\n\
2611
2637
Q\n";
2612
2638
xobj.stream = stream;
@@ -2618,15 +2644,30 @@ Q\n";
2618
2644
var DotRadius = AcroForm.Appearance.internal.getWidth(formObject) <= AcroForm.Appearance.internal.getHeight(formObject) ? AcroForm.Appearance.internal.getWidth(formObject) / 4 : AcroForm.Appearance.internal.getHeight(formObject) / 4;
2619
2645
// The Borderpadding...
2620
2646
DotRadius *= 0.9;
2621
- var c = AcroForm.Appearance.internal.Bezier_C;
2647
+ // Save results for later use; no need to waste processor ticks on doing math
2648
+ var k = DotRadius * 2;
2649
+ // var c = AcroForm.Appearance.internal.Bezier_C;
2650
+ var kc = k * AcroForm.Appearance.internal.Bezier_C;
2651
+ // stream += "0.749023 g\n\
2652
+ // q\n\
2653
+ // 1 0 0 1 " + AcroForm.Appearance.internal.getWidth(formObject) / 2 + " " + AcroForm.Appearance.internal.getHeight(formObject) / 2 + " cm\n\
2654
+ // " + DotRadius * 2 + " 0 m\n\
2655
+ // " + DotRadius * 2 + " " + DotRadius * 2 * c + " " + DotRadius * 2 * c + " " + DotRadius * 2 + " 0 " + DotRadius * 2 + " c\n\
2656
+ // -" + DotRadius * 2 * c + " " + DotRadius * 2 + " -" + DotRadius * 2 + " " + DotRadius * 2 * c + " -" + DotRadius * 2 + " 0 c\n\
2657
+ // -" + DotRadius * 2 + " -" + DotRadius * 2 * c + " -" + DotRadius * 2 * c + " -" + DotRadius * 2 + " 0 -" + DotRadius * 2 + " c\n\
2658
+ // " + DotRadius * 2 * c + " -" + DotRadius * 2 + " " + DotRadius * 2 + " -" + DotRadius * 2 * c + " " + DotRadius * 2 + " 0 c\n\
2659
+ // f\n\
2660
+ // Q\n";
2661
+
2662
+ // FASTER VERSION with less processor ticks spent on math operations
2622
2663
stream += "0.749023 g\n\
2623
2664
q\n\
2624
2665
1 0 0 1 " + AcroForm.Appearance.internal.getWidth(formObject) / 2 + " " + AcroForm.Appearance.internal.getHeight(formObject) / 2 + " cm\n\
2625
- " + DotRadius * 2 + " 0 m\n\
2626
- " + DotRadius * 2 + " " + DotRadius * 2 * c + " " + DotRadius * 2 * c + " " + DotRadius * 2 + " 0 " + DotRadius * 2 + " c\n\
2627
- -" + DotRadius * 2 * c + " " + DotRadius * 2 + " -" + DotRadius * 2 + " " + DotRadius * 2 * c + " -" + DotRadius * 2 + " 0 c\n\
2628
- -" + DotRadius * 2 + " -" + DotRadius * 2 * c + " -" + DotRadius * 2 * c + " -" + DotRadius * 2 + " 0 -" + DotRadius * 2 + " c\n\
2629
- " + DotRadius * 2 * c + " -" + DotRadius * 2 + " " + DotRadius * 2 + " -" + DotRadius * 2 * c + " " + DotRadius * 2 + " 0 c\n\
2666
+ " + k + " 0 m\n\
2667
+ " + k + " " + kc + " " + kc + " " + k + " 0 " + k + " c\n\
2668
+ -" + kc + " " + k + " -" + k + " " + kc + " -" + k + " 0 c\n\
2669
+ -" + k + " -" + kc + " -" + kc + " -" + k + " 0 -" + k + " c\n\
2670
+ " + kc + " -" + k + " " + k + " -" + kc + " " + k + " 0 c\n\
2630
2671
f\n\
2631
2672
Q\n";
2632
2673
xobj.stream = stream;
0 commit comments