Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixes insertion of blank pages during print if page sizes differ #7005

Merged
merged 2 commits into from
Mar 24, 2016
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 0 additions & 3 deletions web/pdf_page_view.js
Original file line number Diff line number Diff line change
Expand Up @@ -532,7 +532,6 @@ var PDFPageView = (function PDFPageViewClosure() {

// The rendered size of the canvas, relative to the size of canvasWrapper.
canvas.style.width = (PRINT_OUTPUT_SCALE * 100) + '%';
canvas.style.height = (PRINT_OUTPUT_SCALE * 100) + '%';

var cssScale = 'scale(' + (1 / PRINT_OUTPUT_SCALE) + ', ' +
(1 / PRINT_OUTPUT_SCALE) + ')';
Expand All @@ -541,8 +540,6 @@ var PDFPageView = (function PDFPageViewClosure() {

var printContainer = document.getElementById('printContainer');
var canvasWrapper = document.createElement('div');
canvasWrapper.style.width = viewport.width + 'pt';
canvasWrapper.style.height = viewport.height + 'pt';
canvasWrapper.appendChild(canvas);
printContainer.appendChild(canvasWrapper);

Expand Down
6 changes: 6 additions & 0 deletions web/viewer.css
Original file line number Diff line number Diff line change
Expand Up @@ -22,12 +22,14 @@

html {
height: 100%;
width: 100%;
/* Font size is needed to make the activity bar the correct size. */
font-size: 10px;
}

body {
height: 100%;
width: 100%;
background-color: #404040;
background-image: url(images/texture.png);
}
Expand Down Expand Up @@ -1800,11 +1802,15 @@ html[dir='rtl'] #documentPropertiesOverlay .row > * {
body[data-mozPrintCallback] #printContainer {
display: block;
}
#printContainer {
height: 100%;
}
/* wrapper around (scaled) print canvas elements */
#printContainer > div {
position: relative;
top: 0;
left: 0;
height: 100%;
overflow: hidden;
}
#printContainer canvas {
Expand Down
4 changes: 0 additions & 4 deletions web/viewer.js
Original file line number Diff line number Diff line change
Expand Up @@ -1166,10 +1166,6 @@ var PDFViewerApplication = {
// Firefox incorrectly reports support for the other value.
'@supports ((size:A4) and (size:1pt 1pt)) {' +
'@page { size: ' + pageSize.width + 'pt ' + pageSize.height + 'pt;}' +
// The canvas and each ancestor node must have a height of 100% to make
// sure that each canvas is printed on exactly one page.
'#printContainer {height:100%}' +
'#printContainer > div {width:100% !important;height:100% !important;}' +
'}';
body.appendChild(this.pageStyleSheet);

Expand Down