[api-minor] Implement API to get MarkInfo from the catalog.

This commit is contained in:
Brendan Dahl 2020-10-23 16:30:36 -07:00
parent 8cf27494b3
commit f5c821e9c3
4 changed files with 84 additions and 0 deletions

View file

@ -805,6 +805,23 @@ class PDFDocumentProxy {
return this._transport.getMetadata();
}
/**
* @typedef {Object} MarkInfo
* Properties correspond to Table 321 of the PDF 32000-1:2008 spec.
* @property {boolean} Marked
* @property {boolean} UserProperties
* @property {boolean} Suspects
*/
/**
* @returns {Promise<MarkInfo | null>} A promise that is resolved with
* a {MarkInfo} object that contains the MarkInfo flags for the PDF
* document, or `null` when no MarkInfo values are present in the PDF file.
*/
getMarkInfo() {
return this._transport.getMarkInfo();
}
/**
* @returns {Promise<TypedArray>} A promise that is resolved with a
* {TypedArray} that has the raw data from the PDF.
@ -2646,6 +2663,10 @@ class WorkerTransport {
});
}
getMarkInfo() {
return this.messageHandler.sendWithPromise("GetMarkInfo", null);
}
getStats() {
return this.messageHandler.sendWithPromise("GetStats", null);
}