mirror of
https://github.com/mozilla/pdf.js.git
synced 2025-04-22 16:18:08 +02:00
Normalize the BBox
entry in Tiling Pattern dictionaries (issue 8117)
According to the PDF specification, see http://www.adobe.com/content/dam/Adobe/en/devnet/acrobat/pdfs/PDF32000_2008.pdf#G7.3982967, the `BBox` entry should have the form `[left, bottom, right, top]`. Since some PDF generators apparently violates the specification, we normalize the `BBox` to ensure that the pattern is (correctly) rendered. Fixes 8117.
This commit is contained in:
parent
2b17188998
commit
098a56270d
3 changed files with 10 additions and 2 deletions
|
@ -318,7 +318,7 @@ var TilingPattern = (function TilingPatternClosure() {
|
|||
function TilingPattern(IR, color, ctx, canvasGraphicsFactory, baseTransform) {
|
||||
this.operatorList = IR[2];
|
||||
this.matrix = IR[3] || [1, 0, 0, 1, 0, 0];
|
||||
this.bbox = IR[4];
|
||||
this.bbox = Util.normalizeRect(IR[4]);
|
||||
this.xstep = IR[5];
|
||||
this.ystep = IR[6];
|
||||
this.paintType = IR[7];
|
||||
|
@ -406,7 +406,7 @@ var TilingPattern = (function TilingPatternClosure() {
|
|||
},
|
||||
|
||||
clipBbox: function clipBbox(graphics, bbox, x0, y0, x1, y1) {
|
||||
if (bbox && isArray(bbox) && bbox.length === 4) {
|
||||
if (isArray(bbox) && bbox.length === 4) {
|
||||
var bboxWidth = x1 - x0;
|
||||
var bboxHeight = y1 - y0;
|
||||
graphics.ctx.rect(x0, y0, bboxWidth, bboxHeight);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue