1
0
Fork 0
mirror of https://github.com/mozilla/pdf.js.git synced 2025-04-20 15:18:08 +02:00

[api-minor] Add support for PageMode in the API (issue 8657)

Please refer to https://wwwimages2.adobe.com/content/dam/Adobe/en/devnet/pdf/pdfs/PDF32000_2008.pdf#page=82.
This commit is contained in:
Jonas Jenwald 2017-07-18 13:08:02 +02:00
parent 4a74cc418c
commit 16c5d41c5b
4 changed files with 55 additions and 0 deletions

View file

@ -630,6 +630,28 @@ describe('api', function() {
});
});
it('gets default page mode', function(done) {
var loadingTask = getDocument(buildGetDocumentParams('tracemonkey.pdf'));
loadingTask.promise.then(function(pdfDocument) {
return pdfDocument.getPageMode();
}).then(function(mode) {
expect(mode).toEqual('UseNone');
loadingTask.destroy().then(done);
}).catch(function (reason) {
done.fail(reason);
});
});
it('gets non-default page mode', function(done) {
doc.getPageMode().then(function(mode) {
expect(mode).toEqual('UseOutlines');
done();
}).catch(function(reason) {
done.fail(reason);
});
});
it('gets non-existent attachments', function(done) {
var promise = doc.getAttachments();
promise.then(function (data) {