Preliminary attachments support

Added a partial Filespec support
Added getAttachments in API
Added a new attachments view in UI (with a new icon by @shorlander)
This commit is contained in:
Samuel Chantaraud 2014-03-18 16:32:47 -04:00
parent 4379f16346
commit 25ee0e8572
13 changed files with 292 additions and 38 deletions

View file

@ -259,6 +259,13 @@ var PDFDocumentProxy = (function PDFDocumentProxyClosure() {
getDestinations: function PDFDocumentProxy_getDestinations() {
return this.transport.getDestinations();
},
/**
* @return {Promise} A promise that is resolved with a lookup table for
* mapping named attachments to their content.
*/
getAttachments: function PDFDocumentProxy_getAttachments() {
return this.transport.getAttachments();
},
/**
* @return {Promise} A promise that is resolved with an array of all the
* JavaScript strings in the name tree.
@ -1046,6 +1053,16 @@ var WorkerTransport = (function WorkerTransportClosure() {
return promise;
},
getAttachments: function WorkerTransport_getAttachments() {
var promise = new PDFJS.LegacyPromise();
this.messageHandler.send('GetAttachments', null,
function transportAttachments(attachments) {
promise.resolve(attachments);
}
);
return promise;
},
startCleanup: function WorkerTransport_startCleanup() {
this.messageHandler.send('Cleanup', null,
function endCleanup() {