From 1c1633e87cd62d37efca451abdde6b7de546a79e Mon Sep 17 00:00:00 2001 From: = <=> Date: Thu, 13 Oct 2011 14:50:47 -0700 Subject: [PATCH 1/3] Making the test for extgstate be an 'eq' test and making the extgstate pdf more robust for picking up errors. --- pdf.js | 2 ++ test/pdfs/extgstate.pdf | 33 ++++++++++++++++++++++----------- 2 files changed, 24 insertions(+), 11 deletions(-) diff --git a/pdf.js b/pdf.js index c76ae7da0..4f5bf08a1 100644 --- a/pdf.js +++ b/pdf.js @@ -4384,6 +4384,7 @@ var PartialEvaluator = (function partialEvaluator() { while (!isEOF(obj = parser.getObj())) { if (isCmd(obj)) { + debugger; var cmd = obj.cmd; var fn = OP_MAP[cmd]; if (!fn) { @@ -5273,6 +5274,7 @@ var CanvasGraphics = (function canvasGraphics() { this.current.leading = -leading; }, setFont: function canvasGraphicsSetFont(fontRef, size) { + debugger; var font; // the tf command uses a name, but graphics state uses a reference if (isName(fontRef)) { diff --git a/test/pdfs/extgstate.pdf b/test/pdfs/extgstate.pdf index 711c45147..3392d9a66 100644 --- a/test/pdfs/extgstate.pdf +++ b/test/pdfs/extgstate.pdf @@ -36,8 +36,9 @@ endobj /Length 8 0 R >> stream + /F0 12 Tf +/F1 12 Tf /GS1 gs -/F0 12 Tf BT 100 700 Td (I should be courier!) Tj @@ -56,10 +57,11 @@ endobj 7 0 obj << /F0 10 0 R +/F1 11 0 R >> endobj 8 0 obj -82 +93 endobj 9 0 obj << @@ -81,25 +83,34 @@ endobj /Encoding /WinAnsiEncoding >> endobj +11 0 obj +<< +/Type /Font +/Subtype /Type1 +/BaseFont /Times-Italic +/Encoding /WinAnsiEncoding +>> +endobj xref -0 11 +0 12 0000000000 65535 f 0000000015 00000 n 0000000078 00000 n 0000000135 00000 n 0000000239 00000 n 0000000304 00000 n -0000000441 00000 n -0000000473 00000 n -0000000505 00000 n -0000000523 00000 n -0000000653 00000 n +0000000452 00000 n +0000000484 00000 n +0000000527 00000 n +0000000545 00000 n +0000000675 00000 n +0000000771 00000 n trailer << /Root 1 0 R -/ID [ ] -/Size 11 +/ID [ ] +/Size 12 >> startxref -749 +872 %%EOF From adfb3b8d318dff0208185d61d49e6b8acb4e94e0 Mon Sep 17 00:00:00 2001 From: = <=> Date: Thu, 13 Oct 2011 14:53:46 -0700 Subject: [PATCH 2/3] Remove debugs --- pdf.js | 2 -- 1 file changed, 2 deletions(-) diff --git a/pdf.js b/pdf.js index 4f5bf08a1..c76ae7da0 100644 --- a/pdf.js +++ b/pdf.js @@ -4384,7 +4384,6 @@ var PartialEvaluator = (function partialEvaluator() { while (!isEOF(obj = parser.getObj())) { if (isCmd(obj)) { - debugger; var cmd = obj.cmd; var fn = OP_MAP[cmd]; if (!fn) { @@ -5274,7 +5273,6 @@ var CanvasGraphics = (function canvasGraphics() { this.current.leading = -leading; }, setFont: function canvasGraphicsSetFont(fontRef, size) { - debugger; var font; // the tf command uses a name, but graphics state uses a reference if (isName(fontRef)) { From 69648006d09dc75899ee2e2c47c766bbdb9d527e Mon Sep 17 00:00:00 2001 From: = <=> Date: Thu, 13 Oct 2011 14:57:56 -0700 Subject: [PATCH 3/3] Change rotation and extgstate to eq tests. --- test/test_manifest.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/test/test_manifest.json b/test/test_manifest.json index 413df5d1f..f564bc48e 100644 --- a/test/test_manifest.json +++ b/test/test_manifest.json @@ -100,7 +100,7 @@ { "id": "rotation", "file": "pdfs/rotation.pdf", "rounds": 1, - "type": "load" + "type": "eq" }, { "id": "ecma262-pdf", "file": "pdfs/ecma262.pdf", @@ -179,7 +179,7 @@ "file": "pdfs/extgstate.pdf", "link": false, "rounds": 1, - "type": "load" + "type": "eq" }, { "id": "usmanm-bad", "file": "pdfs/usmanm-bad.pdf",