I need to display some HTML content as it will be printed. Basically, I want to emulate the browser print preview feature.
I'm not sure how to do this just with HTML/CSS/JavaScript. The only solution I came up is to convert the HTML to PDF so it´s split into pages and then convert that PDF to images and print each image one bellow the other.
It will be really helpfull if someone can point a more straight forward method. I'm not even sure if this is posibble.
BTW, I'm using PHP in the backend, so if there is a PHP class for this it will be helpfull.
The page size for diplaying it will be letter no matter what the user have configured
This how it should look in the browser: