From 8aab1a7a7ba92573cce69d6bb60e6bbefac408a4 Mon Sep 17 00:00:00 2001 From: Yury Delendik Date: Tue, 31 Jul 2012 17:58:28 -0500 Subject: [PATCH 1/6] Fix loading of the font widths --- src/evaluator.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/evaluator.js b/src/evaluator.js index 059ff113f..fe369db27 100644 --- a/src/evaluator.js +++ b/src/evaluator.js @@ -765,7 +765,7 @@ var PartialEvaluator = (function PartialEvaluatorClosure() { if (widths) { var start = 0, end = 0; for (var i = 0, ii = widths.length; i < ii; i++) { - var code = widths[i]; + var code = xref.fetchIfRef(widths[i]); if (isArray(code)) { for (var j = 0, jj = code.length; j < jj; j++) glyphsWidths[start++] = code[j]; From 9c14b1abfb08b55d55810d0a7dbbfcee736f6ef5 Mon Sep 17 00:00:00 2001 From: Yury Delendik Date: Wed, 1 Aug 2012 11:05:33 -0500 Subject: [PATCH 2/6] Add ref test --- test/test_manifest.json | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/test/test_manifest.json b/test/test_manifest.json index 1b372e906..c3054ed54 100644 --- a/test/test_manifest.json +++ b/test/test_manifest.json @@ -363,6 +363,14 @@ "link": true, "type": "eq" }, + { "id": "issue1944", + "file": "pdfs/issue1944.pdf", + "md5": "a4ef22c380b55747fb3d4a1c276b0950", + "rounds": 1, + "pageLimit": 2, + "link": true, + "type": "eq" + }, { "id": "issue1586", "file": "pdfs/pdfjsbad1586.pdf", "md5": "793d0870f0b0c613799b0677d64daca4", From 12bc84fd2412a081a7ca529b56bb0a9914fec3a9 Mon Sep 17 00:00:00 2001 From: Yury Delendik Date: Wed, 1 Aug 2012 12:20:52 -0500 Subject: [PATCH 3/6] Missing .link file --- test/pdfs/issue1944.pdf.link | 1 + 1 file changed, 1 insertion(+) create mode 100644 test/pdfs/issue1944.pdf.link diff --git a/test/pdfs/issue1944.pdf.link b/test/pdfs/issue1944.pdf.link new file mode 100644 index 000000000..6a233f06a --- /dev/null +++ b/test/pdfs/issue1944.pdf.link @@ -0,0 +1 @@ +http://mygenshare.com/slideshows/13452/original/original.pdf \ No newline at end of file From 41a427246370eccef480c6177b3b18def3877af1 Mon Sep 17 00:00:00 2001 From: Yury Delendik Date: Wed, 1 Aug 2012 15:10:48 -0500 Subject: [PATCH 4/6] Implement textRise; reduce ref test to one page --- src/canvas.js | 5 +++-- test/test_manifest.json | 2 +- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/src/canvas.js b/src/canvas.js index 32c171216..058b57b7e 100644 --- a/src/canvas.js +++ b/src/canvas.js @@ -157,6 +157,7 @@ var CanvasExtraState = (function CanvasExtraStateClosure() { this.wordSpacing = 0; this.textHScale = 1; this.textRenderingMode = TextRenderingMode.FILL; + this.textRise = 0; // Color spaces this.fillColorSpace = new DeviceGrayCS(); this.fillColorSpaceObj = null; @@ -601,7 +602,7 @@ var CanvasGraphics = (function CanvasGraphicsClosure() { this.current.textRenderingMode = mode; }, setTextRise: function CanvasGraphics_setTextRise(rise) { - TODO('text rise: ' + rise); + this.current.textRise = rise; }, moveText: function CanvasGraphics_moveText(x, y) { this.current.x = this.current.lineX += x; @@ -628,7 +629,7 @@ var CanvasGraphics = (function CanvasGraphicsClosure() { ctx.transform.apply(ctx, current.textMatrix); ctx.scale(1, -1); - ctx.translate(current.x, -1 * current.y); + ctx.translate(current.x, -current.y - current.textRise); ctx.transform.apply(ctx, fontMatrix); ctx.scale(textHScale, 1); }, diff --git a/test/test_manifest.json b/test/test_manifest.json index c3054ed54..8651fc953 100644 --- a/test/test_manifest.json +++ b/test/test_manifest.json @@ -367,7 +367,7 @@ "file": "pdfs/issue1944.pdf", "md5": "a4ef22c380b55747fb3d4a1c276b0950", "rounds": 1, - "pageLimit": 2, + "pageLimit": 1, "link": true, "type": "eq" }, From 3c4efb2f796b5ab10b06a53452e6b371ca2a4652 Mon Sep 17 00:00:00 2001 From: Yury Delendik Date: Thu, 2 Aug 2012 11:54:40 -0500 Subject: [PATCH 5/6] Removes issue1944 reftest --- test/pdfs/issue1944.pdf.link | 1 - test/test_manifest.json | 8 -------- 2 files changed, 9 deletions(-) delete mode 100644 test/pdfs/issue1944.pdf.link diff --git a/test/pdfs/issue1944.pdf.link b/test/pdfs/issue1944.pdf.link deleted file mode 100644 index 6a233f06a..000000000 --- a/test/pdfs/issue1944.pdf.link +++ /dev/null @@ -1 +0,0 @@ -http://mygenshare.com/slideshows/13452/original/original.pdf \ No newline at end of file diff --git a/test/test_manifest.json b/test/test_manifest.json index 8651fc953..1b372e906 100644 --- a/test/test_manifest.json +++ b/test/test_manifest.json @@ -363,14 +363,6 @@ "link": true, "type": "eq" }, - { "id": "issue1944", - "file": "pdfs/issue1944.pdf", - "md5": "a4ef22c380b55747fb3d4a1c276b0950", - "rounds": 1, - "pageLimit": 1, - "link": true, - "type": "eq" - }, { "id": "issue1586", "file": "pdfs/pdfjsbad1586.pdf", "md5": "793d0870f0b0c613799b0677d64daca4", From 129e81de9fbfa7d2e6a59f81e3129f7075a6fda8 Mon Sep 17 00:00:00 2001 From: Brendan Dahl Date: Thu, 2 Aug 2012 12:06:43 -0700 Subject: [PATCH 6/6] Clean up the test manifest file. --- test/pdfs/issue1001.pdf.link | 1 - test/pdfs/lista_preliminar.pdf.link | 1 - test/pdfs/wdsg_fitc.pdf.link | 2 +- test/test_manifest.json | 17 +---------------- 4 files changed, 2 insertions(+), 19 deletions(-) delete mode 100644 test/pdfs/issue1001.pdf.link delete mode 100644 test/pdfs/lista_preliminar.pdf.link diff --git a/test/pdfs/issue1001.pdf.link b/test/pdfs/issue1001.pdf.link deleted file mode 100644 index 24e1bebc2..000000000 --- a/test/pdfs/issue1001.pdf.link +++ /dev/null @@ -1 +0,0 @@ -http://www.myhillsapartment.com/island_club/floorplans/images/links/Island_IC_brochure.pdf diff --git a/test/pdfs/lista_preliminar.pdf.link b/test/pdfs/lista_preliminar.pdf.link deleted file mode 100644 index 54102b3b1..000000000 --- a/test/pdfs/lista_preliminar.pdf.link +++ /dev/null @@ -1 +0,0 @@ -http://www.lfg.com.br/concursodebolsas/lista_preliminar_classificao.pdf diff --git a/test/pdfs/wdsg_fitc.pdf.link b/test/pdfs/wdsg_fitc.pdf.link index 77d3b590d..bd22b86ba 100644 --- a/test/pdfs/wdsg_fitc.pdf.link +++ b/test/pdfs/wdsg_fitc.pdf.link @@ -1 +1 @@ -http://www.airgid.com/book/wdsg_fitc.pdf +http://www.airgid.com/wp-content/uploads/2012/06/wdsg_fitc.pdf diff --git a/test/test_manifest.json b/test/test_manifest.json index 1b372e906..0a22160b9 100644 --- a/test/test_manifest.json +++ b/test/test_manifest.json @@ -334,14 +334,6 @@ "skipPages": [1], "type": "eq" }, - { "id": "lista_preliminar", - "file": "pdfs/lista_preliminar.pdf", - "md5": "4eff251319eeb660ba8a7a5cfac7787d", - "rounds": 1, - "link": true, - "pageLimit": 3, - "type": "eq" - }, { "id": "issue919", "file": "pdfs/issue919.pdf", "md5": "3a1716a512aca4d7a8d6106bd4885d14", @@ -356,13 +348,6 @@ "rounds": 1, "type": "eq" }, - { "id": "issue1001", - "file": "pdfs/issue1001.pdf", - "md5": "0f1496e80a82a923e91d9e74c55ad94e", - "rounds": 1, - "link": true, - "type": "eq" - }, { "id": "issue1586", "file": "pdfs/pdfjsbad1586.pdf", "md5": "793d0870f0b0c613799b0677d64daca4", @@ -421,7 +406,7 @@ "file": "pdfs/issue1096.pdf", "md5": "7f75d2b4b93c78d401ff39e8c1b00612", "rounds": 1, - "pageLimit": 10, + "pageLimit": 9, "link": true, "type": "eq" },