Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Print preview and print only prints a portion of my web page

I have a rather large table data I need to print, but when I go to Print Preview or Print, I only see what's currently visible on the page, and not the entire content of the web page.

This happens in all browser. What could be causing this?

like image 267
Stefan Kendall Avatar asked Feb 26 '23 23:02

Stefan Kendall


1 Answers

Oh my god, I spent so much time on it...

I wanted to use puppeteer to generate a pdf and I didn't understand why it only printed the first page in the output pdf.

Here was the reason: I had set properties overflow: auto and height: 100% on tag <body>. Once I've removed it, it worked fine.

I hope it can help someone.

like image 111
Klem231188 Avatar answered Apr 01 '23 10:04

Klem231188