Recovering from RGBT-command (ref #577)
This commit is contained in:
parent
846fc1755c
commit
d409355f62
14
pdf.js
14
pdf.js
@ -4366,6 +4366,20 @@ var PartialEvaluator = (function partialEvaluator() {
|
|||||||
if (isCmd(obj)) {
|
if (isCmd(obj)) {
|
||||||
var cmd = obj.cmd;
|
var cmd = obj.cmd;
|
||||||
var fn = OP_MAP[cmd];
|
var fn = OP_MAP[cmd];
|
||||||
|
if (!fn) {
|
||||||
|
// invalid content command, trying to recover
|
||||||
|
if (cmd.substr(-2) == 'BT') {
|
||||||
|
fn = OP_MAP[cmd.substr(0, cmd.length - 2)];
|
||||||
|
// feeding 'BT' on next interation
|
||||||
|
parser = {
|
||||||
|
getObj: function() {
|
||||||
|
parser = this.oldParser;
|
||||||
|
return { name: 'BT' };
|
||||||
|
},
|
||||||
|
oldParser: parser
|
||||||
|
};
|
||||||
|
}
|
||||||
|
}
|
||||||
assertWellFormed(fn, "Unknown command '" + cmd + "'");
|
assertWellFormed(fn, "Unknown command '" + cmd + "'");
|
||||||
// TODO figure out how to type-check vararg functions
|
// TODO figure out how to type-check vararg functions
|
||||||
|
|
||||||
|
1
test/pdfs/vesta.pdf.link
Normal file
1
test/pdfs/vesta.pdf.link
Normal file
@ -0,0 +1 @@
|
|||||||
|
http://www-csag.ucsd.edu/~jburke/Vesta/Vesta_Overview.pdf
|
@ -158,6 +158,12 @@
|
|||||||
"rounds": 1,
|
"rounds": 1,
|
||||||
"type": "load"
|
"type": "load"
|
||||||
},
|
},
|
||||||
|
{ "id": "vesta-bad",
|
||||||
|
"file": "pdfs/vesta.pdf",
|
||||||
|
"link": true,
|
||||||
|
"rounds": 1,
|
||||||
|
"type": "load"
|
||||||
|
},
|
||||||
{ "id": "ibwa-bad",
|
{ "id": "ibwa-bad",
|
||||||
"file": "pdfs/ibwa-bad.pdf",
|
"file": "pdfs/ibwa-bad.pdf",
|
||||||
"link": true,
|
"link": true,
|
||||||
|
Loading…
Reference in New Issue
Block a user