@@ -1243,13 +1243,14 @@ export default class PDFPage {
12431243 opacity : options . opacity ,
12441244 borderOpacity : options . borderOpacity ,
12451245 blendMode : options . blendMode ,
1246+ softmask : options . softmask ,
12461247 } ) ;
12471248
12481249 if ( ! ( 'color' in options ) && ! ( 'borderColor' in options ) ) {
12491250 options . borderColor = rgb ( 0 , 0 , 0 ) ;
12501251 }
12511252
1252- const contentStream = this . getContentStream ( ) ;
1253+ const contentStream = options . content_stream || this . getContentStream ( ) ;
12531254 contentStream . push (
12541255 ...drawSvgPath ( path , {
12551256 x : options . x ?? this . x ,
@@ -1264,6 +1265,7 @@ export default class PDFPage {
12641265 borderLineCap : options . borderLineCap ?? undefined ,
12651266 graphicsState : graphicsStateKey ,
12661267 pattern : options . pattern ?? undefined ,
1268+ clip : options . clip ?? undefined ,
12671269 } ) ,
12681270 ) ;
12691271 }
@@ -1385,12 +1387,14 @@ export default class PDFPage {
13851387 opacity : options . opacity ,
13861388 borderOpacity : options . borderOpacity ,
13871389 blendMode : options . blendMode ,
1390+ softmask : options . softmask ,
13881391 } ) ;
13891392
13901393 if ( ! ( 'color' in options ) && ! ( 'borderColor' in options ) ) {
13911394 options . color = rgb ( 0 , 0 , 0 ) ;
13921395 }
13931396
1397+ /*
13941398 const test = drawRectangle({
13951399 x: options.x ?? this.x,
13961400 y: options.y ?? this.y,
@@ -1409,8 +1413,13 @@ export default class PDFPage {
14091413 pattern: options.pattern ?? undefined,
14101414 });
14111415 console.info({test, options});
1416+ */
14121417
1413- const contentStream = this . getContentStream ( ) ;
1418+ if ( options . content_stream ) {
1419+ console . info ( 'using passed content stream' ) ;
1420+ }
1421+
1422+ const contentStream = options . content_stream || this . getContentStream ( ) ;
14141423 contentStream . push (
14151424 ...drawRectangle ( {
14161425 x : options . x ?? this . x ,
@@ -1603,13 +1612,15 @@ export default class PDFPage {
16031612 opacity ?: number ;
16041613 borderOpacity ?: number ;
16051614 blendMode ?: BlendMode ;
1615+ softmask ?: PDFDict ;
16061616 } ) : PDFName | undefined {
1607- const { opacity, borderOpacity, blendMode } = options ;
1617+ const { opacity, borderOpacity, blendMode, softmask } = options ;
16081618
16091619 if (
16101620 opacity === undefined &&
16111621 borderOpacity === undefined &&
1612- blendMode === undefined
1622+ blendMode === undefined &&
1623+ softmask === undefined
16131624 ) {
16141625 return undefined ;
16151626 }
@@ -1619,6 +1630,7 @@ export default class PDFPage {
16191630 ca : opacity ,
16201631 CA : borderOpacity ,
16211632 BM : blendMode ,
1633+ SMask : softmask ,
16221634 } ) ;
16231635
16241636 const key = this . node . newExtGState ( 'GS' , graphicsState ) ;
0 commit comments