mirror of
https://github.com/zen-browser/pdf.js.git
synced 2025-07-09 17:55:37 +02:00
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:
parent
4379f16346
commit
25ee0e8572
13 changed files with 292 additions and 38 deletions
|
@ -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() {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue