Merge pull request #7374 from Snuffleupagus/fix-getTextContent-setGState
Fix errors in `setGState` in `PartialEvaluator_getTextContent` that prevents text-selection from working properly
This commit is contained in:
commit
5a5bb99734
@ -1402,7 +1402,7 @@ var PartialEvaluator = (function PartialEvaluatorClosure() {
|
|||||||
case OPS.setFont:
|
case OPS.setFont:
|
||||||
flushTextContentItem();
|
flushTextContentItem();
|
||||||
textState.fontSize = args[1];
|
textState.fontSize = args[1];
|
||||||
next(handleSetFont(args[0].name));
|
next(handleSetFont(args[0].name, null));
|
||||||
return;
|
return;
|
||||||
case OPS.setTextRise:
|
case OPS.setTextRise:
|
||||||
flushTextContentItem();
|
flushTextContentItem();
|
||||||
@ -1608,21 +1608,17 @@ var PartialEvaluator = (function PartialEvaluatorClosure() {
|
|||||||
var dictName = args[0];
|
var dictName = args[0];
|
||||||
var extGState = resources.get('ExtGState');
|
var extGState = resources.get('ExtGState');
|
||||||
|
|
||||||
if (!isDict(extGState) || !extGState.has(dictName.name)) {
|
if (!isDict(extGState) || !isName(dictName)) {
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
var gState = extGState.get(dictName.name);
|
||||||
var gsStateMap = extGState.get(dictName.name);
|
if (!isDict(gState)) {
|
||||||
var gsStateFont = null;
|
break;
|
||||||
for (var key in gsStateMap) {
|
|
||||||
if (key === 'Font') {
|
|
||||||
assert(!gsStateFont);
|
|
||||||
gsStateFont = gsStateMap[key];
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
if (gsStateFont) {
|
var gStateFont = gState.get('Font');
|
||||||
textState.fontSize = gsStateFont[1];
|
if (gStateFont) {
|
||||||
next(handleSetFont(gsStateFont[0]));
|
textState.fontSize = gStateFont[1];
|
||||||
|
next(handleSetFont(null, gStateFont[0]));
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
@ -737,6 +737,13 @@
|
|||||||
"rounds": 1,
|
"rounds": 1,
|
||||||
"type": "eq"
|
"type": "eq"
|
||||||
},
|
},
|
||||||
|
{ "id": "extgstate-text",
|
||||||
|
"file": "pdfs/extgstate.pdf",
|
||||||
|
"md5": "001bb4ec04463a01d93aad748361f049",
|
||||||
|
"link": false,
|
||||||
|
"rounds": 1,
|
||||||
|
"type": "text"
|
||||||
|
},
|
||||||
{ "id": "usmanm-bad",
|
{ "id": "usmanm-bad",
|
||||||
"file": "pdfs/usmanm-bad.pdf",
|
"file": "pdfs/usmanm-bad.pdf",
|
||||||
"md5": "38afb822433aaf07fc8f54807cd4f61a",
|
"md5": "38afb822433aaf07fc8f54807cd4f61a",
|
||||||
|
Loading…
Reference in New Issue
Block a user