Merge pull request #13100 from emilio/container-overflow
print: Ensure print containers have the right size and don't create overflow.
This commit is contained in:
commit
eb92ed12f2
@ -39,6 +39,8 @@ function composePage(
|
|||||||
|
|
||||||
const canvasWrapper = document.createElement("div");
|
const canvasWrapper = document.createElement("div");
|
||||||
canvasWrapper.appendChild(canvas);
|
canvasWrapper.appendChild(canvas);
|
||||||
|
canvasWrapper.style.width = canvas.style.width;
|
||||||
|
canvasWrapper.style.height = canvas.style.height;
|
||||||
printContainer.appendChild(canvasWrapper);
|
printContainer.appendChild(canvasWrapper);
|
||||||
|
|
||||||
// A callback for a given page may be executed multiple times for different
|
// A callback for a given page may be executed multiple times for different
|
||||||
|
@ -198,6 +198,8 @@ PDFPrintService.prototype = {
|
|||||||
|
|
||||||
const wrapper = document.createElement("div");
|
const wrapper = document.createElement("div");
|
||||||
wrapper.appendChild(img);
|
wrapper.appendChild(img);
|
||||||
|
wrapper.style.width = img.style.width;
|
||||||
|
wrapper.style.height = img.style.height;
|
||||||
this.printContainer.appendChild(wrapper);
|
this.printContainer.appendChild(wrapper);
|
||||||
|
|
||||||
return new Promise(function (resolve, reject) {
|
return new Promise(function (resolve, reject) {
|
||||||
|
@ -1758,12 +1758,9 @@ html[dir="rtl"] #documentPropertiesOverlay .row > * {
|
|||||||
}
|
}
|
||||||
/* wrapper around (scaled) print canvas elements */
|
/* wrapper around (scaled) print canvas elements */
|
||||||
#printContainer > div {
|
#printContainer > div {
|
||||||
position: relative;
|
/* Without the following max-height declaration, Chromium might create extra
|
||||||
top: 0;
|
* blank pages, even though it shouldn't! */
|
||||||
left: 0;
|
max-height: 100%;
|
||||||
width: 1px;
|
|
||||||
height: 1px;
|
|
||||||
overflow: visible;
|
|
||||||
page-break-after: always;
|
page-break-after: always;
|
||||||
page-break-inside: avoid;
|
page-break-inside: avoid;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user