]> git.parisson.com Git - pdf.js.git/commitdiff
Adjust heuristic to properly handle unicode characters
authorYury Delendik <ydelendik@mozilla.com>
Tue, 22 May 2012 03:15:09 +0000 (22:15 -0500)
committerYury Delendik <ydelendik@mozilla.com>
Tue, 22 May 2012 03:15:09 +0000 (22:15 -0500)
src/evaluator.js
test/pdfs/issue1721.pdf.link [new file with mode: 0644]
test/test_manifest.json

index 1dab7de0b3476f26704029eed45c8a56abf9263c..1a8db147352076b320b162dcc41fe8aca226edd4 100644 (file)
@@ -611,8 +611,9 @@ var PartialEvaluator = (function PartialEvaluatorClosure() {
             }
           } else if (octet == 0x3E) {
             if (token.length) {
-              // XXX guessing chars size by checking number size in the CMap
-              if (token.length <= 2 && properties.composite)
+              // Heuristic: guessing chars size by checking numbers sizes
+              // in the CMap entries.
+              if (token.length == 2 && properties.composite)
                 properties.wideChars = false;
 
               if (token.length <= 4) {
diff --git a/test/pdfs/issue1721.pdf.link b/test/pdfs/issue1721.pdf.link
new file mode 100644 (file)
index 0000000..5a36166
--- /dev/null
@@ -0,0 +1 @@
+http://www.lezarts.org/07oforhom/Faitsdivers/Hadopi/Le%20Rapport%20Hadopi,%20Intox.pdf
index 4706b68c4d6c79ca3a6cba3c895594dc76177f25..be30d6c81b0494724520ef6bfe89551a02916ba0 100644 (file)
       "link": false,
       "type": "eq"
     },
+    {  "id": "issue1721",
+      "file": "pdfs/issue1721.pdf",
+      "md5": "b47177f9e5197a76ec498733ecab60e6",
+      "rounds": 1,
+      "pageLimit": 2,
+      "link": true,
+      "type": "eq"
+    },
     {  "id": "issue1243",
       "file": "pdfs/issue1243.pdf",
       "md5": "130c849b83513d5ac5e03c6421fc7489",