Forum Discussion
LukeBlake
7 years agoCommunity Member
Printing off center using the window.print(); java script
I am trying to create a print capability for my results page using the window.print(): java script. It will print the page, but it is off center (to the right) and cuts off part of the page.
This...
Jean-Guy-Boulay
4 years agoCommunity Member
I have a better solution than scaling the content. Being inspired by ChristianKing in another thread I created a style to translate the content horizontally. Storyline always wraps content in a Div called "wrapper". So we can target that Div. It works perfectly if you reduce your print margins to zero, otherwise you might have to adjust the scale to something like 95% if you want margins.
//document.body.style.zoom = .95; //set scale to 95% if you need margins
document.getElementById("wrapper").style.transform = "translate(-220px)";
setTimeout(window.print(), 1000);
//setTimeout(document.body.style.zoom = 1, 1010); //set scale back to normal
Related Content
- 9 months ago
- 2 years ago
- 3 months ago