@@ -881,7 +881,11 @@ class Annotation {
881881 ) ;
882882 if ( ! appearance ) {
883883 if ( ! isUsingOwnCanvas ) {
884- return new OperatorList ( ) ;
884+ return {
885+ opList : new OperatorList ( ) ,
886+ separateForm : false ,
887+ separateCanvas : false ,
888+ } ;
885889 }
886890 appearance = new StringStream ( "" ) ;
887891 appearance . dict = new Dict ( ) ;
@@ -930,7 +934,7 @@ class Annotation {
930934 opList . addOp ( OPS . endMarkedContent , [ ] ) ;
931935 }
932936 this . reset ( ) ;
933- return opList ;
937+ return { opList, separateForm : false , separateCanvas : isUsingOwnCanvas } ;
934938 }
935939
936940 async save ( evaluator , task , annotationStorage ) {
@@ -1619,7 +1623,11 @@ class WidgetAnnotation extends Annotation {
16191623 // Do not render form elements on the canvas when interactive forms are
16201624 // enabled. The display layer is responsible for rendering them instead.
16211625 if ( renderForms && ! ( this instanceof SignatureWidgetAnnotation ) ) {
1622- return new OperatorList ( ) ;
1626+ return {
1627+ opList : new OperatorList ( ) ,
1628+ separateForm : true ,
1629+ separateCanvas : false ,
1630+ } ;
16231631 }
16241632
16251633 if ( ! this . _hasText ) {
@@ -1647,12 +1655,12 @@ class WidgetAnnotation extends Annotation {
16471655 ) ;
16481656 }
16491657
1650- const operatorList = new OperatorList ( ) ;
1658+ const opList = new OperatorList ( ) ;
16511659
16521660 // Even if there is an appearance stream, ignore it. This is the
16531661 // behaviour used by Adobe Reader.
16541662 if ( ! this . _defaultAppearance || content === null ) {
1655- return operatorList ;
1663+ return { opList , separateForm : false , separateCanvas : false } ;
16561664 }
16571665
16581666 const matrix = [ 1 , 0 , 0 , 1 , 0 , 0 ] ;
@@ -1672,10 +1680,10 @@ class WidgetAnnotation extends Annotation {
16721680 ) ;
16731681 }
16741682 if ( optionalContent !== undefined ) {
1675- operatorList . addOp ( OPS . beginMarkedContentProps , [ "OC" , optionalContent ] ) ;
1683+ opList . addOp ( OPS . beginMarkedContentProps , [ "OC" , optionalContent ] ) ;
16761684 }
16771685
1678- operatorList . addOp ( OPS . beginAnnotation , [
1686+ opList . addOp ( OPS . beginAnnotation , [
16791687 this . data . id ,
16801688 this . data . rect ,
16811689 transform ,
@@ -1688,14 +1696,14 @@ class WidgetAnnotation extends Annotation {
16881696 stream,
16891697 task,
16901698 resources : this . _fieldResources . mergedResources ,
1691- operatorList,
1699+ operatorList : opList ,
16921700 } ) ;
1693- operatorList . addOp ( OPS . endAnnotation , [ ] ) ;
1701+ opList . addOp ( OPS . endAnnotation , [ ] ) ;
16941702
16951703 if ( optionalContent !== undefined ) {
1696- operatorList . addOp ( OPS . endMarkedContent , [ ] ) ;
1704+ opList . addOp ( OPS . endMarkedContent , [ ] ) ;
16971705 }
1698- return operatorList ;
1706+ return { opList , separateForm : false , separateCanvas : false } ;
16991707 }
17001708
17011709 _getMKDict ( rotation ) {
@@ -2477,7 +2485,11 @@ class ButtonWidgetAnnotation extends WidgetAnnotation {
24772485 }
24782486
24792487 // No appearance
2480- return new OperatorList ( ) ;
2488+ return {
2489+ opList : new OperatorList ( ) ,
2490+ separateForm : false ,
2491+ separateCanvas : false ,
2492+ } ;
24812493 }
24822494
24832495 async save ( evaluator , task , annotationStorage ) {
0 commit comments