mdpdf icon indicating copy to clipboard operation
mdpdf copied to clipboard

Feature request: page breaks

Open ryan-williams opened this issue 1 year ago • 2 comments

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 avatar Jan 05 '24 01:01 ryan-williams

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>

ryan-williams avatar Jan 05 '24 01:01 ryan-williams

You can do page breaks using this

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

Nuckle avatar Mar 23 '24 17:03 Nuckle