mirror of
https://github.com/mozilla/pdf.js.git
synced 2025-04-21 15:48:06 +02:00
[api-minor] Add basic support for PageLayout in the API and the viewer
Please see the specification, https://www.adobe.com/content/dam/acom/en/devnet/acrobat/pdfs/PDF32000_2008.pdf#G6.2393749, and refer to the inline comments for additional details.
This commit is contained in:
parent
57abddc9ca
commit
7a999d1d67
5 changed files with 85 additions and 2 deletions
|
@ -610,6 +610,24 @@ describe('api', function() {
|
|||
}).catch(done.fail);
|
||||
});
|
||||
|
||||
it('gets default page layout', function(done) {
|
||||
var loadingTask = getDocument(buildGetDocumentParams('tracemonkey.pdf'));
|
||||
|
||||
loadingTask.promise.then(function(pdfDocument) {
|
||||
return pdfDocument.getPageLayout();
|
||||
}).then(function(mode) {
|
||||
expect(mode).toEqual('');
|
||||
|
||||
loadingTask.destroy().then(done);
|
||||
}).catch(done.fail);
|
||||
});
|
||||
it('gets non-default page layout', function(done) {
|
||||
doc.getPageLayout().then(function(mode) {
|
||||
expect(mode).toEqual('SinglePage');
|
||||
done();
|
||||
}).catch(done.fail);
|
||||
});
|
||||
|
||||
it('gets default page mode', function(done) {
|
||||
var loadingTask = getDocument(buildGetDocumentParams('tracemonkey.pdf'));
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue