Skip to content
This repository has been archived by the owner on Apr 3, 2020. It is now read-only.

Commit

Permalink
Fix problem that the default page size auto is not respected when pri…
Browse files Browse the repository at this point in the history
…nt to PDF
  • Loading branch information
MurakamiShinyu committed Mar 27, 2019
1 parent 16006a3 commit fff481c
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/js/models/document-options.js
Original file line number Diff line number Diff line change
Expand Up @@ -88,12 +88,17 @@ class DocumentOptions {
url
}));
}
const userStyleSheetArray = convertStyleSheetArray(this.userStyleSheet());
if (this.pageStyle.pageSizeMode() == PageStyle.Mode.DEFAULT) {
// Put default page size auto. This is needed to output auto size PDF.
userStyleSheetArray.unshift({text: "@page{size:auto}"});
}
// Do not include url
// (url is a required argument to Viewer.loadDocument, separated from other options)
return {
fragment: this.fragment(),
authorStyleSheet: convertStyleSheetArray(this.authorStyleSheet()),
userStyleSheet: convertStyleSheetArray(this.userStyleSheet())
userStyleSheet: userStyleSheetArray
};
}

Expand Down

0 comments on commit fff481c

Please sign in to comment.