Merge pull request #12525 from brendandahl/mark-info

[api-minor] Implement API to get MarkInfo from the catalog.
This commit is contained in:
Tim van der Meij 2020-10-31 00:05:19 +01:00 committed by GitHub
commit e341e6e542
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
5 changed files with 116 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.
@ -2639,6 +2656,10 @@ class WorkerTransport {
});
}
getMarkInfo() {
return this.messageHandler.sendWithPromise("GetMarkInfo", null);
}
getStats() {
return this.messageHandler.sendWithPromise("GetStats", null);
}