mirror of
https://github.com/mozilla/pdf.js.git
synced 2025-04-22 16:18:08 +02:00
Merge pull request #1494 from yurydelendik/convert-docinfo
Convert Unicode strings in the document info
This commit is contained in:
commit
2e92c0ea08
2 changed files with 11 additions and 4 deletions
11
src/core.js
11
src/core.js
|
@ -597,8 +597,15 @@ var PDFDocModel = (function PDFDocModelClosure() {
|
|||
},
|
||||
getDocumentInfo: function PDFDocModel_getDocumentInfo() {
|
||||
var info;
|
||||
if (this.xref.trailer.has('Info'))
|
||||
info = this.xref.trailer.get('Info');
|
||||
if (this.xref.trailer.has('Info')) {
|
||||
var infoDict = this.xref.trailer.get('Info');
|
||||
|
||||
info = {};
|
||||
infoDict.forEach(function(key, value) {
|
||||
info[key] = typeof value !== 'string' ? value :
|
||||
stringToPDFString(value);
|
||||
});
|
||||
}
|
||||
|
||||
return shadow(this, 'getDocumentInfo', info);
|
||||
},
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue