mirror of
https://github.com/mozilla/pdf.js.git
synced 2025-04-20 15:18:08 +02:00
Merge pull request #8673 from Snuffleupagus/api-pageMode
[api-minor] Add support for PageMode in the API and viewer (issue 8657)
This commit is contained in:
commit
af71ea7a7d
7 changed files with 123 additions and 28 deletions
|
@ -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) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue