Printing a page results

Hi,
I would like to print a page results.
I add a button that execute the js window.print().
Effectively it prints the page, but it’s empty.
I attach two images that better explain what happens.
Can you help me?
Thank you
Stefano


Hi Stefano,

It seems that the HTML content is cut off due to a narrow print page size.
Please try changing the print settings (page layout to Landscape, and/or paper size) to see if it works.

Regards

Hi,

It seems work well with Firefox but not Google Chrome. In the case you want to generate a certificate image, please take a look at this thread Email copy of slide

Regards,

Hi,
thank you for your answer. Unfortunately this is not the solution. Changing to landscape, I can see part of the slide in the preview.
Now we know that it’s necessary to reduce the size of the page to fit A4 paper size.
Seems that depends on responsive settings.
I changed the window size as you can see in the attached image, and now the printing is (nearly) correct.
Any idea for a correct printing at any resolution?
Thank you

Hi Stefano,

Some browsers such as Firefox, Edge will shrink the content to fit the print page by default.
But on Chrome, I afraid that there’s no solution, except the viewer must change the print settings or resize the browser window manually.

Regards

What do you think about a css resizing?
For example:
@page {size: 210mm 297mm; margin: 30mm;}

In this case, where i should put the css? Only after the export, manually in css?

Thank you

Hi Stefano,

You should do that only when printing:

var currentBodyWidth = document.body.style.width;
// change body width before printing & relayout
document.body.style.width = '210mm';
prez.layout();
// print
window.print();
// restore body width
document.body.style.width = currentBodyWidth;
prez.layout();

Regards

Thank you very much.
Now it’s perfect.