diff --git a/pdf.js b/pdf.js index 0b810a3ee..84c173f23 100644 --- a/pdf.js +++ b/pdf.js @@ -4324,14 +4324,16 @@ var PartialEvaluator = (function() { baseEncoding = Encodings[baseName.name].slice(); // Load the differences between the base and original - var diffEncoding = encoding.get('Differences'); - var index = 0; - for (var j = 0; j < diffEncoding.length; j++) { - var data = diffEncoding[j]; - if (IsNum(data)) - index = data; - else - differences[index++] = data.name; + if (encoding.has('Differences')) { + var diffEncoding = encoding.get('Differences'); + var index = 0; + for (var j = 0; j < diffEncoding.length; j++) { + var data = diffEncoding[j]; + if (IsNum(data)) + index = data; + else + differences[index++] = data.name; + } } } else if (IsName(encoding)) { baseEncoding = Encodings[encoding.name].slice(); diff --git a/test/pdfs/txt2pdf.pdf.link b/test/pdfs/txt2pdf.pdf.link new file mode 100644 index 000000000..09653f39c --- /dev/null +++ b/test/pdfs/txt2pdf.pdf.link @@ -0,0 +1 @@ +http://www.sanface.com/pdf/test.pdf diff --git a/test/test_manifest.json b/test/test_manifest.json index 44955eefa..a3115764a 100644 --- a/test/test_manifest.json +++ b/test/test_manifest.json @@ -133,5 +133,11 @@ "link": true, "rounds": 1, "type": "load" + }, + { "id": "txt2pdf", + "file": "pdfs/txt2pdf.pdf", + "link": true, + "rounds": 1, + "type": "load" } ]