Skip to content

Commit 9165dc0

Browse files
Merge pull request #13480 from Snuffleupagus/generic-viewer-print
[GENERIC viewer] Fix printing regression from PR 13411
2 parents e962d77 + daf8461 commit 9165dc0

File tree

4 files changed

+7
-9
lines changed

4 files changed

+7
-9
lines changed

web/firefox_print_service.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ function composePage(
3434
canvas.height = Math.floor(size.height * PRINT_UNITS);
3535

3636
const canvasWrapper = document.createElement("div");
37-
canvasWrapper.setAttribute("class", "printedPage");
37+
canvasWrapper.className = "printedPage";
3838
canvasWrapper.appendChild(canvas);
3939
printContainer.appendChild(canvasWrapper);
4040

web/pdf_print_service.js

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -163,10 +163,8 @@ PDFPrintService.prototype = {
163163
this._printResolution,
164164
this._optionalContentConfigPromise
165165
)
166-
.then(() => {
167-
this.useRenderedPage.bind(this);
168-
})
169-
.then(() => {
166+
.then(this.useRenderedPage.bind(this))
167+
.then(function () {
170168
renderNextPage(resolve, reject);
171169
}, reject);
172170
};
@@ -189,7 +187,7 @@ PDFPrintService.prototype = {
189187
}
190188

191189
const wrapper = document.createElement("div");
192-
wrapper.setAttribute("class", "printedPage");
190+
wrapper.className = "printedPage";
193191
wrapper.appendChild(img);
194192
this.printContainer.appendChild(wrapper);
195193

web/ui_utils.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1002,7 +1002,7 @@ function getXfaHtmlForPrinting(printContainer, pdfDocument) {
10021002
const scale = Math.round(CSS_UNITS * 100) / 100;
10031003
for (const xfaPage of xfaHtml.children) {
10041004
const page = document.createElement("div");
1005-
page.setAttribute("class", "xfaPrintedPage");
1005+
page.className = "xfaPrintedPage";
10061006
printContainer.appendChild(page);
10071007

10081008
const { width, height } = xfaPage.attributes.style;

web/viewer.css

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1839,8 +1839,8 @@ html[dir="rtl"] #documentPropertiesOverlay .row > * {
18391839
position: relative;
18401840
}
18411841

1842-
.printedPage canvas,
1843-
.printedPage img {
1842+
#printContainer > .printedPage canvas,
1843+
#printContainer > .printedPage img {
18441844
/* The intrinsic canvas / image size will make sure that we fit the page. */
18451845
max-width: 100%;
18461846
max-height: 100%;

0 commit comments

Comments
 (0)