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: page breaks #165

Open
ryan-williams opened this issue Jan 5, 2024 · 2 comments
Open

Feature request: page breaks #165

ryan-williams opened this issue Jan 5, 2024 · 2 comments

Comments

@ryan-williams
Copy link

It would be neat if some markdown, HTML, or CSS sentinel value could be interpreted by mdpdf as a "page break."

I love this tool, but often spend a lot of time futzing with CSS, or tweaking copy, to e.g. get a heading to flow to the next page (rather than dangling at the end of a page, with its content starting on the next page).

A couple options, off-hand:

  • --hr-page-breaks: interpret Markdown --- (normally an HTML <hr/> tag) as a page break
  • <div class="page-break"></div> or similar
@ryan-williams
Copy link
Author

In the meantime, I'm using a spacer element like:

<div style="height: 10em"></div>

While debugging, a border is helpful:

<div style="height: 10em; border: 1px solid black"></div>

@nuckle
Copy link

nuckle commented Mar 23, 2024

You can do page breaks using this

<div style="page-break-before:always;"></div>

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

2 participants