File tree Expand file tree Collapse file tree 4 files changed +15
-1
lines changed Expand file tree Collapse file tree 4 files changed +15
-1
lines changed Original file line number Diff line number Diff line change @@ -187,6 +187,7 @@ var CanvasExtraState = (function CanvasExtraStateClosure() {
187
187
this .fillAlpha = 1 ;
188
188
this .strokeAlpha = 1 ;
189
189
this .lineWidth = 1 ;
190
+ this .paintFormXObjectDepth = 0 ;
190
191
191
192
this .old = old ;
192
193
}
@@ -1109,6 +1110,7 @@ var CanvasGraphics = (function CanvasGraphicsClosure() {
1109
1110
paintFormXObjectBegin : function CanvasGraphics_paintFormXObjectBegin (matrix ,
1110
1111
bbox ) {
1111
1112
this .save ();
1113
+ this .current .paintFormXObjectDepth ++;
1112
1114
1113
1115
if (matrix && isArray (matrix ) && 6 == matrix .length )
1114
1116
this .transform .apply (this , matrix );
@@ -1123,7 +1125,12 @@ var CanvasGraphics = (function CanvasGraphicsClosure() {
1123
1125
},
1124
1126
1125
1127
paintFormXObjectEnd : function CanvasGraphics_paintFormXObjectEnd () {
1126
- this .restore ();
1128
+ var depth = this .current .paintFormXObjectDepth ;
1129
+ do {
1130
+ this .restore ();
1131
+ // some pdf don't close all restores inside object
1132
+ // closing those for them
1133
+ } while (this .current .paintFormXObjectDepth >= depth );
1127
1134
},
1128
1135
1129
1136
paintJpegXObject : function CanvasGraphics_paintJpegXObject (objId , w , h ) {
Original file line number Diff line number Diff line change 24
24
! pdfkit_compressed.pdf
25
25
! TAMReview.pdf
26
26
! issue918.pdf
27
+ ! issue1905.pdf
27
28
! issue1249.pdf
28
29
! smaskdim.pdf
29
30
! type4psfunc.pdf
Original file line number Diff line number Diff line change 367
367
"pageLimit" : 3 ,
368
368
"type" : " eq"
369
369
},
370
+ { "id" : " issue1905" ,
371
+ "file" : " pdfs/issue1905.pdf" ,
372
+ "md5" : " b1bbd72ca6522ae1502aa26320f81994" ,
373
+ "rounds" : 1 ,
374
+ "type" : " eq"
375
+ },
370
376
{ "id" : " issue918" ,
371
377
"file" : " pdfs/issue918.pdf" ,
372
378
"md5" : " d582cc0f2592ae82936589ced2a47e55" ,
You can’t perform that action at this time.
0 commit comments