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 143 forks source link

Landscape #12

Closed dreua closed 2 years ago

dreua commented 3 years ago

Is there an option to use a sheet in landscape orientation?

ocram commented 3 years ago

Thanks!

Yes, in theory, it should work if you open the CSS for your paper size (e.g. sheets-of-paper-a4.css) and make three modifications:

Replace

width: 21cm;

with

width: 29.7cm;

and replace

min-height: 29.7cm;

with

min-height: 21cm;

and finally replace

size: A4 portrait;

with

size: A4 landscape;

Whether this actually works in practice probably depends on your client or user agent. Chrome usually delivers the best results of all popular browsers. Special-purpose renderers may provide even better results.

ocram commented 2 years ago

This does indeed provide decent results. Documentation has been added to the README now: https://github.com/delight-im/HTML-Sheets-of-Paper/commit/89fd14aa548e1595e14e908d04ca7c9618bcd909