Formatting print with CSS - Is it possible in Electron?


#1

Hi,

I’ve been trying to format printed output with HTML+CSS but cannot make it work.

For instance, if you have a CSS such as this …

@media print{
    @page{
        @top-center{
             content: "hello world";
        }
    }
}

… it is just ignored when you print to paper. A lot of the CSS printing stuff doesn’t work, making it very hard to use HTML+CSS for nicely formatted prints.

Does anyone know if this is possible, or should I look elsewhere? I’ve previously tested to programmatically generate output with TeX or LaTeX. It works, but it would be nice to limit the number of libraries and modules you use.