Hi,

Is it possible to add a page-break, new page somehow?

Cheers
Chris

Comments

cstachris’s picture

Adding paragraph elements makes room, but it's a hit and miss way of doing it. Is there a better way?

<p/>
<p/>
<p/>
<p/>
jcnventura’s picture

Status: Active » Postponed (maintainer needs more info)

If you're using dompdf, it's possible to add inline PHP (http://www.digitaljunkies.ca/dompdf/usage.php#inline).

If you're using TCPDF, it's not possible, sorry.

João

jcnventura’s picture

Status: Postponed (maintainer needs more info) » Closed (fixed)

No further info in two weeks. Closing the issue.

feedbackloop’s picture

With wkhtmltopdf, you can apply the CSS page-break-after: always; to any block-level element. So for example:

<div id="page">
The content of your page.
</div>

And then, in css/print.css in the print/ module directory:

#page {
   page-break-after: always;
}

At least, this worked for me.

lavino’s picture

I just tried with tcpdf and I added a line:

p style="page-break-before: always" (wrap them in bigger smaller signs of course..)

I got the page break in the pdf output. So I don't why everyone said it is not possible in tcpdf?

jcnventura’s picture

Because you're using a version of TCPDF that evolved a lot since 18 months ago.

eme’s picture

style="page-break-before: always" works as well with dompdf (no need for inline PHP).

argiepiano’s picture

Issue summary: View changes

I have a View of nodes. I want to print each node in a separate page. I'm using TCPDF. I have not been able to figure out how to add a page break of the type #5 above mentioned. I added a Global: Custom Text field as the last field in the View Fields list, but this is not working. Any help will be appreciated. Thanks!

EDIT: I found a solution - Rather than using an inline style definition inside the html tag (which gets filtered out by Views' Global: Custom Text field), I used the option "Create a CSS class" in "Style Setting" for the Custom Text field. I created a new CSS class that included 'page-break-before: always;' in the print.css file. NB: use the print.css file inside /sites/all/modules/print/css/ folder.