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

Page breaking before <form> #1249

Closed
rgmrtn opened this issue Nov 12, 2020 · 4 comments
Closed

Page breaking before <form> #1249

rgmrtn opened this issue Nov 12, 2020 · 4 comments
Labels
CSS Questions about how to do something with CSS

Comments

@rgmrtn
Copy link

rgmrtn commented Nov 12, 2020

The weasyprint PDF output is breaking the page just before a form element, when the form element is bigger than a page. I've tried adding the following style to the page:

*{
  break-inside: avoid !important;
  page-break-inside: avoid !important;
}
form{
  break-before: avoid !important;
  page-break-before: avoid !important;
  break-inside: auto !important;
  page-break-inside: auto !important;
}

to prevent page breaks anywhere but in the form, but it still breaks the page before the <form> element, and not in the form element.

Any advice?

@liZe
Copy link
Member

liZe commented Nov 14, 2020

Hi!

There’s nothing special in forms about page breaks, it should work. Could you please provide a sample or an example showing your problem?

@rgmrtn
Copy link
Author

rgmrtn commented Nov 16, 2020

Hi @liZe

Here is the HTML code https://hastebin.com/ilicaxirip.http , and attached is the PDF with the issue.

Thank you
AGL-20201112-Near_Miss_Form_sub59.pdf

@liZe
Copy link
Member

liZe commented Nov 23, 2020

The problem is caused by #36: there’s currently no page break in flex boxes, that are set on .row elements by Bootstrap.

A simple workaround for your use case is to render these rows as blocks, but it will probably break other things (columns at least):

.row {
  display: block;
}

Unfortunately, there’s no simple solution until we fix #36.

@liZe liZe closed this as completed Nov 23, 2020
@liZe liZe added the CSS Questions about how to do something with CSS label Nov 23, 2020
@rgmrtn
Copy link
Author

rgmrtn commented Nov 24, 2020

Thank you this did the trick!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CSS Questions about how to do something with CSS
Projects
None yet
Development

No branches or pull requests

2 participants