Skip to content

page-break not working #717

@za1sle

Description

@za1sle

Hi, I'm using the package in Django framework. This is the element I'd like to transfer to PDF:

{% for action_item in action_items_data %}
<div class="{{ action_item.category }} care-plan content" style="break-inside: auto; break-after: auto; break-before: auto;">
  <h4>{{ action_item.category_display }} - {{ action_item.title }}</h4>
  {% for sentence in action_item.text %}
    <span>{{ sentence | safe }}</span>
  {% endfor %}
</div>
{% endfor %}
var opt = {
    margin: [-0.5, 0, 0, 0],
    image: { type: 'jpeg', quality: 0.98 },
    html2canvas: { scale: 4 },
    jsPDF: { unit: 'in', format: 'a4', orientation: 'portrait' },
    pagebreak: {mode: "css"}
}
html2pdf().set(opt).from(element).save();

When the content of an element exceeds one page, the extra content is not displayed in the PDF after conversion.
image

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions