I have an issue with the print page layout in the latest versions of Chrome and Edge (v126). When I adjust the scale settings in the print dialog, the page layout gets distorted and shifts to the left. I have attached a screenshot to illustrate the problem. Has anyone encountered this issue or know a solution?
in new version: ( The blurred part is the size of the element that I want to print )
Everything is correct in the old versions and in the Firefox browser
I think the page body is not hidden in print
2
Answers
There are definitely print issues in Chrome 126. I don’t know if what you’re describing is the same thing, but one issue I’ve been able to reproduce in a number of pages including my own is the contents get shifted vertically and off the page if you’ve scrolled down prior to printing. As a workaround, if you’re a developer with any control of the print initiation in the your web app you can call window.scrollTo(0, 0) before calling any print commands. For extra good measure you can save off the scrolled coordinates before scrolling to 0,0 and then reset them after calling window.print().
https://support.google.com/chrome/thread/279981342/print-issue-when-printing-in-version-126-0-6478-62-64-bit?hl=en
I added the code below to solve this problem in every way anyone tries to print in Chrome.
window.addEventListener('beforeprint', function (event) { window.scrollTo(0, 0) });