Skip to content

[GENERIC viewer] Fix printing regression from PR 13411 #13480

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

Merged
merged 1 commit into from
Jun 2, 2021
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
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