delight-im / HTML-Sheets-of-Paper

Word processor in your browser using HTML and CSS (for invoices, legal notices, etc.)
https://delight-im.github.io/HTML-Sheets-of-Paper/
MIT License
1.22k stars 142 forks source link

Automatic Page Breaks #19

Open calnexus opened 1 year ago

calnexus commented 1 year ago

Is there a way to add automated page breaks like in MS word without relying on the manual .page CSS rule when the page height is exceeded?

ocram commented 1 year ago

Thanks!

The live demo, which loads /index.html, has some JavaScript added that aims to take care of this. Have you tried it or seen it?

calnexus commented 1 year ago

Yes I have ,it doesn't work. Maybe i have some other library blocking the code.I managed to fix it by using javascript timers // window.addEventListener("DOMContentLoaded", function() { // applyPageBreaks(); // });

setTimeout(() => { applyPageBreaks(); }, 1000);