Fix undefined group bounding box
This commit is contained in:
parent
1ce8afc23c
commit
4ae3802484
@ -1507,10 +1507,11 @@ var CanvasGraphics = (function CanvasGraphicsClosure() {
|
|||||||
group.bbox,
|
group.bbox,
|
||||||
currentCtx.mozCurrentTransform);
|
currentCtx.mozCurrentTransform);
|
||||||
// Clip the bounding box to the current canvas.
|
// Clip the bounding box to the current canvas.
|
||||||
bounds = Util.intersect(bounds, [0,
|
var canvasBounds = [0,
|
||||||
0,
|
0,
|
||||||
currentCtx.canvas.width,
|
currentCtx.canvas.width,
|
||||||
currentCtx.canvas.height]);
|
currentCtx.canvas.height];
|
||||||
|
bounds = Util.intersect(bounds, canvasBounds) || [0, 0, 0, 0];
|
||||||
// Use ceil in case we're between sizes so we don't create canvas that is
|
// Use ceil in case we're between sizes so we don't create canvas that is
|
||||||
// too small and make the canvas at least 1x1 pixels.
|
// too small and make the canvas at least 1x1 pixels.
|
||||||
var drawnWidth = Math.max(Math.ceil(bounds[2] - bounds[0]), 1);
|
var drawnWidth = Math.max(Math.ceil(bounds[2] - bounds[0]), 1);
|
||||||
|
1
test/pdfs/issue3879.pdf.link
Normal file
1
test/pdfs/issue3879.pdf.link
Normal file
@ -0,0 +1 @@
|
|||||||
|
http://particuliers.lcl.fr/quotidien/cartes/simplifier_quotidien/carte-visa-cleo/Ressources/pdf/dispositions_generales_cb_cleo.pdf
|
@ -33,6 +33,15 @@
|
|||||||
"type": "load",
|
"type": "load",
|
||||||
"about": "PDF with undefined stream length."
|
"about": "PDF with undefined stream length."
|
||||||
},
|
},
|
||||||
|
{ "id": "issue3879",
|
||||||
|
"file": "pdfs/issue3879.pdf",
|
||||||
|
"md5": "1cd1f1c3271515a14e65ff2980e14663",
|
||||||
|
"rounds": 1,
|
||||||
|
"link": true,
|
||||||
|
"firstPage": 2,
|
||||||
|
"lastPage": 2,
|
||||||
|
"type": "eq"
|
||||||
|
},
|
||||||
{ "id": "issue2833",
|
{ "id": "issue2833",
|
||||||
"file": "pdfs/issue2833.pdf",
|
"file": "pdfs/issue2833.pdf",
|
||||||
"md5": "7bc6e17c41586155c188d7408bcb9ab5",
|
"md5": "7bc6e17c41586155c188d7408bcb9ab5",
|
||||||
|
Loading…
Reference in New Issue
Block a user