Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature Request: Support printing (e.g. @media print, page-break: etc...) #120

Open
tig opened this issue Jan 1, 2020 · 0 comments
Open

Comments

@tig
Copy link
Contributor

tig commented Jan 1, 2020

Here's the scenario. My app prints HTML (specifically, pretty-printed source code using prismjs). I can't have a line of source code at the bottom of a page be split in half between that page and the next page.

This is what page-break-before: always is for.

Not sure how this would be implemented.

For now i have implemented an awful hack where, because I generate the HTML, i know line height and I can calculate how many lines fit on a page. With this, i'm able to adjust my draw code to account for lines that overflow.

This screen shot has some diagnostics turned on that also turns off clipping:
image

Same content, with my diagnostics off, showing that it works. But man is this a hack:
image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant