Skip to content

Commit 281568f

Browse files
author
Ben Gribaudo
committed
Allow use of select PDF path-painting operators
getStyle() now allows direct use of select PDF path-painting operators
1 parent e8a92c1 commit 281568f

File tree

1 file changed

+11
-2
lines changed

1 file changed

+11
-2
lines changed

jspdf.js

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
* Copyright (c) 2010-2014 James Hall, https://github.com/MrRio/jsPDF
77
* 2010 Aaron Spike, https://github.com/acspike
88
* 2012 Willow Systems Corporation, willow-systems.com
9-
* 2012 Pablo Hess, https://github.com/pablohess
9+
* 2012 Pablo Hess, https://github.gcom/pablohess
1010
* 2012 Florian Jenett, https://github.com/fjenett
1111
* 2013 Warren Weckesser, https://github.com/warrenweckesser
1212
* 2013 Youssef Beddad, https://github.com/lifof
@@ -711,12 +711,21 @@ var jsPDF = (function(global) {
711711
return content.join('\n');
712712
},
713713
getStyle = function(style) {
714-
// see Path-Painting Operators of PDF spec
714+
// see path-painting operators in PDF spec
715715
var op = 'S'; // stroke
716716
if (style === 'F') {
717717
op = 'f'; // fill
718718
} else if (style === 'FD' || style === 'DF') {
719719
op = 'B'; // both
720+
} else if (style === 'f' || style === 'f*' || style === 'B' || style === 'B*') {
721+
/*
722+
Allow direct use of these PDF path-painting operators:
723+
- f fill using nonzero winding number rule
724+
- f* fill using even-odd rule
725+
- B fill then stroke with fill using non-zero winding number rule
726+
- B* fill then stroke with fill using even-odd rule
727+
*/
728+
op = style;
720729
}
721730
return op;
722731
},

0 commit comments

Comments
 (0)