2

I have made a html-template in CiviCRM consisting only of this kind of html tag: <div style="position: absolute;">

This works perfect for selecting a template for pdf printing, when printing only one page. Then I have the opportunity to place certain elements at the appropriate place on my letter.

The problem arises, when selecting a bunch of contacts, and then creating pdf-s to all of them at the same time. Then it only prints all on one single pdf-page, instead of one page pr. contact. I want the CiviCRM-template to print the <div> tag on one page pr. contact.

Is there a trick here I don't know? And if so, please explain...

(My site is using wkhtmltopdf to generate the pdf-s)

3

I figured it out on my own. To print <div> on different pages, it needs to be positioned relative.

So, I ended up putting all the existing <div> with position absolute into a <div> with position relative.

However, that is not sufficient enough, I also needed to fill in a simple <br /> tag as well.

This worked:

<div id="page" style="position: relative;">

<br />

<div id="content" style="position: absolute;">

</div>

</div>

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.