|
|
@ -272,10 +272,7 @@ var PDFDocumentProxy = (function PDFDocumentProxyClosure() { |
|
|
|
* JavaScript strings in the name tree. |
|
|
|
* JavaScript strings in the name tree. |
|
|
|
*/ |
|
|
|
*/ |
|
|
|
getJavaScript: function PDFDocumentProxy_getJavaScript() { |
|
|
|
getJavaScript: function PDFDocumentProxy_getJavaScript() { |
|
|
|
return new Promise(function (resolve) { |
|
|
|
return this.transport.getJavaScript(); |
|
|
|
var js = this.pdfInfo.javaScript; |
|
|
|
|
|
|
|
resolve(js); |
|
|
|
|
|
|
|
}.bind(this)); |
|
|
|
|
|
|
|
}, |
|
|
|
}, |
|
|
|
/** |
|
|
|
/** |
|
|
|
* @return {Promise} A promise that is resolved with an {Array} that is a |
|
|
|
* @return {Promise} A promise that is resolved with an {Array} that is a |
|
|
@ -293,10 +290,7 @@ var PDFDocumentProxy = (function PDFDocumentProxyClosure() { |
|
|
|
* ]. |
|
|
|
* ]. |
|
|
|
*/ |
|
|
|
*/ |
|
|
|
getOutline: function PDFDocumentProxy_getOutline() { |
|
|
|
getOutline: function PDFDocumentProxy_getOutline() { |
|
|
|
return new Promise(function (resolve) { |
|
|
|
return this.transport.getOutline(); |
|
|
|
var outline = this.pdfInfo.outline; |
|
|
|
|
|
|
|
resolve(outline); |
|
|
|
|
|
|
|
}.bind(this)); |
|
|
|
|
|
|
|
}, |
|
|
|
}, |
|
|
|
/** |
|
|
|
/** |
|
|
|
* @return {Promise} A promise that is resolved with an {Object} that has |
|
|
|
* @return {Promise} A promise that is resolved with an {Object} that has |
|
|
@ -305,14 +299,7 @@ var PDFDocumentProxy = (function PDFDocumentProxyClosure() { |
|
|
|
* {Metadata} object with information from the metadata section of the PDF. |
|
|
|
* {Metadata} object with information from the metadata section of the PDF. |
|
|
|
*/ |
|
|
|
*/ |
|
|
|
getMetadata: function PDFDocumentProxy_getMetadata() { |
|
|
|
getMetadata: function PDFDocumentProxy_getMetadata() { |
|
|
|
return new Promise(function (resolve) { |
|
|
|
return this.transport.getMetadata(); |
|
|
|
var info = this.pdfInfo.info; |
|
|
|
|
|
|
|
var metadata = this.pdfInfo.metadata; |
|
|
|
|
|
|
|
resolve({ |
|
|
|
|
|
|
|
info: info, |
|
|
|
|
|
|
|
metadata: (metadata ? new PDFJS.Metadata(metadata) : null) |
|
|
|
|
|
|
|
}); |
|
|
|
|
|
|
|
}.bind(this)); |
|
|
|
|
|
|
|
}, |
|
|
|
}, |
|
|
|
/** |
|
|
|
/** |
|
|
|
* @return {Promise} A promise that is resolved with a TypedArray that has |
|
|
|
* @return {Promise} A promise that is resolved with a TypedArray that has |
|
|
@ -1066,6 +1053,39 @@ var WorkerTransport = (function WorkerTransportClosure() { |
|
|
|
}.bind(this)); |
|
|
|
}.bind(this)); |
|
|
|
}, |
|
|
|
}, |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
getJavaScript: function WorkerTransport_getJavaScript() { |
|
|
|
|
|
|
|
return new Promise(function (resolve) { |
|
|
|
|
|
|
|
this.messageHandler.send('GetJavaScript', null, |
|
|
|
|
|
|
|
function transportJavaScript(js) { |
|
|
|
|
|
|
|
resolve(js); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
); |
|
|
|
|
|
|
|
}.bind(this)); |
|
|
|
|
|
|
|
}, |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
getOutline: function WorkerTransport_getOutline() { |
|
|
|
|
|
|
|
return new Promise(function (resolve) { |
|
|
|
|
|
|
|
this.messageHandler.send('GetOutline', null, |
|
|
|
|
|
|
|
function transportOutline(outline) { |
|
|
|
|
|
|
|
resolve(outline); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
); |
|
|
|
|
|
|
|
}.bind(this)); |
|
|
|
|
|
|
|
}, |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
getMetadata: function WorkerTransport_getMetadata() { |
|
|
|
|
|
|
|
return new Promise(function (resolve) { |
|
|
|
|
|
|
|
this.messageHandler.send('GetMetadata', null, |
|
|
|
|
|
|
|
function transportMetadata(results) { |
|
|
|
|
|
|
|
resolve({ |
|
|
|
|
|
|
|
info: results[0], |
|
|
|
|
|
|
|
metadata: (results[1] ? new PDFJS.Metadata(results[1]) : null) |
|
|
|
|
|
|
|
}); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
); |
|
|
|
|
|
|
|
}.bind(this)); |
|
|
|
|
|
|
|
}, |
|
|
|
|
|
|
|
|
|
|
|
startCleanup: function WorkerTransport_startCleanup() { |
|
|
|
startCleanup: function WorkerTransport_startCleanup() { |
|
|
|
this.messageHandler.send('Cleanup', null, |
|
|
|
this.messageHandler.send('Cleanup', null, |
|
|
|
function endCleanup() { |
|
|
|
function endCleanup() { |
|
|
|