1
0
Fork 0
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:
Jonas Jenwald 2019-04-03 13:48:18 +02:00
parent 57abddc9ca
commit 7a999d1d67
5 changed files with 85 additions and 2 deletions

View file

@ -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'));