Expected behavior (Expected behaviour is that visuals should be visible on printed pages regardless if users use CTRL+P or our print icon.)
Actual behavior (Actual behaviour is that when the printing is triggered with a JavaScript call (via the print button on our website), the animated Everviz visuals don’t show on print unless users have scrolled all the way down to the page first to load them in view.)
Thank you for sharing the details and the example page.
I’ve tested the issue, and as you noted, printing via CTRL+P works fine because the visuals have typically been loaded by the time users print this way. However, when using the print button on the top right, the visuals don’t always appear in the print output. This happens because the animated charts often load only when they come into view, and the print button triggers window.print() immediately, without ensuring all visuals are fully loaded.
Suggested Solution:
One way to handle this is to make sure the entire page is scrolled before triggering the print command. This would allow the visuals to load properly before printing.
Here’s an example of how this could be implemented by using JS:
const printButton = document.querySelector('.a2a_button_print');
if (printButton) {
printButton.addEventListener('click', function(event) {
// Scroll to the bottom to trigger loading of visuals
window.scrollTo(0, document.body.scrollHeight);
setTimeout(() => {
window.print();
}, 200); // You can adjust the delay based on loading speed
});
}
Please let me know if you have any further questions. Thanks for your patience!