Skip to content

Commit

Permalink
Merge pull request #13480 from Snuffleupagus/generic-viewer-print
Browse files Browse the repository at this point in the history
[GENERIC viewer] Fix printing regression from PR 13411
  • Loading branch information
Snuffleupagus authored Jun 2, 2021
2 parents e962d77 + daf8461 commit 9165dc0
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 9 deletions.
2 changes: 1 addition & 1 deletion web/firefox_print_service.js
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ function composePage(
canvas.height = Math.floor(size.height * PRINT_UNITS);

const canvasWrapper = document.createElement("div");
canvasWrapper.setAttribute("class", "printedPage");
canvasWrapper.className = "printedPage";
canvasWrapper.appendChild(canvas);
printContainer.appendChild(canvasWrapper);

Expand Down
8 changes: 3 additions & 5 deletions web/pdf_print_service.js
Original file line number Diff line number Diff line change
Expand Up @@ -163,10 +163,8 @@ PDFPrintService.prototype = {
this._printResolution,
this._optionalContentConfigPromise
)
.then(() => {
this.useRenderedPage.bind(this);
})
.then(() => {
.then(this.useRenderedPage.bind(this))
.then(function () {
renderNextPage(resolve, reject);
}, reject);
};
Expand All @@ -189,7 +187,7 @@ PDFPrintService.prototype = {
}

const wrapper = document.createElement("div");
wrapper.setAttribute("class", "printedPage");
wrapper.className = "printedPage";
wrapper.appendChild(img);
this.printContainer.appendChild(wrapper);

Expand Down
2 changes: 1 addition & 1 deletion web/ui_utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -1002,7 +1002,7 @@ function getXfaHtmlForPrinting(printContainer, pdfDocument) {
const scale = Math.round(CSS_UNITS * 100) / 100;
for (const xfaPage of xfaHtml.children) {
const page = document.createElement("div");
page.setAttribute("class", "xfaPrintedPage");
page.className = "xfaPrintedPage";
printContainer.appendChild(page);

const { width, height } = xfaPage.attributes.style;
Expand Down
4 changes: 2 additions & 2 deletions web/viewer.css
Original file line number Diff line number Diff line change
Expand Up @@ -1839,8 +1839,8 @@ html[dir="rtl"] #documentPropertiesOverlay .row > * {
position: relative;
}

.printedPage canvas,
.printedPage img {
#printContainer > .printedPage canvas,
#printContainer > .printedPage img {
/* The intrinsic canvas / image size will make sure that we fit the page. */
max-width: 100%;
max-height: 100%;
Expand Down

0 comments on commit 9165dc0

Please sign in to comment.