Answers.Body: <p>I would create two templates, one for single page, and one for two pages. And then search for those with too many contributions to fit one page.</p>
  <p>And then use page-break</p>
  <p><a href="https://civicrm.stackexchange.com/a/6606">https://civicrm.stackexchange.com/a/6606</a></p>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2021-06-22T17:34:10.410Z
Answers.LastActivityDate: 2021-06-22T17:34:10.410Z
Answers.UserDisplayName: Flying
Answers.Body: <p>I cannot tell you how to do a page break and it probably also depends on your pdf library (e.g. dompdf or wkhtmltopdf).</p>
  
  <p>You could however consider using one of the existing extensions for donation receipts to create the Year-end receipts. There are several around, one we created quite a while ago can be found here: <a href="https://github.com/systopia/de.systopia.donrec" rel="nofollow noreferrer">https://github.com/systopia/de.systopia.donrec</a></p>
  
  <p>The documentation can be found here: <a href="https://wiki.civicrm.org/confluence/display/CRM/DonationReceipts+Extension" rel="nofollow noreferrer">https://wiki.civicrm.org/confluence/display/CRM/DonationReceipts+Extension</a></p>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2020-01-24T16:44:52.187Z
Answers.Text: I looked at that one, but we need line item info and it appeared it does not offer that detail.
Answers.UserDisplayName: Iowa Boy
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2020-01-24T07:49:16.417Z
Answers.LastActivityDate: 2020-01-24T07:49:16.417Z
Answers.UserDisplayName: Fabian
Body: <p>Drupal 7.69
  CiviCRM 5.20</p>
  
  <p>We use Thank-You letters for our Year-end receipts. We use line-items for our fund accounting. If a donor gives monthly to more than 2 funds, the search result for the letter is too long to fit on one page. So it starts the next letter on the partial page. If the results are short enough, it all works great.
  How do I force it to start each letter on full pages?</p>
  
  <p>Here is my message template code</p>
  
  <pre><code>&lt;table border="0" style="width: 900px;"&gt;
  &lt;tbody&gt;
      &lt;tr&gt;
          &lt;td width="30%"&gt;&lt;img height="auto" src="log url here" width="275" /&gt;&lt;/td&gt;
      &lt;/tr&gt;
      &lt;tr&gt;
          &lt;td style="text-align:left; font-weight: bold; padding-top:60px;" width="50%"&gt;{contact.addressee}&lt;/td&gt;
          &lt;th style="padding-top:60px; text-align:center; color:#70551F;padding-left:100px; "&gt;2019 Contribution Statement&lt;/th&gt;
      &lt;/tr&gt;
      &lt;tr&gt;
          &lt;td style="text-align:left; " width="40%"&gt;{contact.street_address}&lt;/td&gt;
          &lt;td style="text-align:center; font-style: italic; color:#281c1d;padding-left:100px;  "&gt;January 1, 2019 - December 31, 2019&lt;/td&gt;
      &lt;/tr&gt;
      &lt;tr&gt;
          &lt;td width="40%"&gt;{contact.city}, {contact.state_province} {contact.postal_code}&lt;/td&gt;
          &lt;td style="text-align:center; font-style: italic; color:#281c1d; padding-left:100px; "&gt;Federal Id # 27-4638772&lt;/td&gt;
      &lt;/tr&gt;
      &lt;tr&gt;
          &lt;td colspan="2" style="text-align:center; color:#70551F; padding-top:20px; padding-bottom:20px;"&gt;____________________________________________&lt;/td&gt;
      &lt;/tr&gt;
  &lt;/tbody&gt;
  </code></pre>
  
  <p></p>
  
  Thank you for your support of Radius International in 2019</p>
  
  <p>No goods or services were received for these Tax Deductible contributions</p>
  
  
      
          
              Date
              Cont ID
              Contribution Designation
              Amount
          
          
          
              {$date}
              {$contribution.id}
              {$lineitem.label}
              $ {$lineitem.line_total}
          
          
          
              2019 Total Contributions
              $ {$contribution_aggregate}
          
      
  
  
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2021-02-18T15:00:35.950Z
Comments.Text: Currently we add the donors that give to more than 27 line item entries in a year to a group (Group name Large#Donors). Then when we run thank you letters we filter as NOT in this group. Then run the thank-you letters and we do not have this problem. For the ones in the group, we process those one at a time.
Comments.UserDisplayName: Iowa Boy
Tags: <message-templates>
Title: How to set Thank-You Letter template to start the next letter on a new page
ThreadText: # How to set Thank-You Letter template to start the next letter on a new page
  
  (Asked by: username_0 on 2020-01-22)
  
  Drupal 7.69
  CiviCRM 5.20
  
  We use Thank-You letters for our Year-end receipts. We use line-items for our fund accounting. If a donor gives monthly to more than 2 funds, the search result for the letter is too long to fit on one page. So it starts the next letter on the partial page. If the results are short enough, it all works great.
  How do I force it to start each letter on full pages?
  
  Here is my message template code
  
  ```
  <table border="0" style="width: 900px;">
  <tbody>
      <tr>
          <td width="30%"><img height="auto" src="log url here" width="275" /></td>
      </tr>
      <tr>
          <td style="text-align:left; font-weight: bold; padding-top:60px;" width="50%">{contact.addressee}</td>
          <th style="padding-top:60px; text-align:center; color:#70551F;padding-left:100px; ">2019 Contribution Statement</th>
      </tr>
      <tr>
          <td style="text-align:left; " width="40%">{contact.street_address}</td>
          <td style="text-align:center; font-style: italic; color:#281c1d;padding-left:100px;  ">January 1, 2019 - December 31, 2019</td>
      </tr>
      <tr>
          <td width="40%">{contact.city}, {contact.state_province} {contact.postal_code}</td>
          <td style="text-align:center; font-style: italic; color:#281c1d; padding-left:100px; ">Federal Id # 27-4638772</td>
      </tr>
      <tr>
          <td colspan="2" style="text-align:center; color:#70551F; padding-top:20px; padding-bottom:20px;">____________________________________________</td>
      </tr>
  </tbody>
  
  ```
  
  Thank you for your support of Radius International in 2019
  
  No goods or services were received for these Tax Deductible contributions
  
  Date
  Cont ID
  Contribution Designation
  Amount
  {$date}
  {$contribution.id}
  {$lineitem.label}
  $ {$lineitem.line\_total}
  2019 Total Contributions
  $ {$contribution\_aggregate}
  
  **Tags:** message-templates
  
  > **Comments:**
  > **username_0**: Currently we add the donors that give to more than 27 line item entries in a year to a group (Group name Large#Donors). Then when we run thank you letters we filter as NOT in this group. Then run the thank-you letters and we do not have this problem. For the ones in the group, we process those one at a time.  
  
  ---
  
  ## 2 answers
  
  ### Answer by username_1 on 2021-06-22. Score: 1
  
  I would create two templates, one for single page, and one for two pages. And then search for those with too many contributions to fit one page.
  
  And then use page-break
  
  <https://civicrm.stackexchange.com/a/6606>
  
  
  ---
  
  ### Answer by username_2 on 2020-01-24. Score: 1
  
  I cannot tell you how to do a page break and it probably also depends on your pdf library (e.g. dompdf or wkhtmltopdf).
  
  You could however consider using one of the existing extensions for donation receipts to create the Year-end receipts. There are several around, one we created quite a while ago can be found here: <https://github.com/systopia/de.systopia.donrec>
  
  The documentation can be found here: <https://wiki.civicrm.org/confluence/display/CRM/DonationReceipts+Extension>
  
  > **Comments:**
  > **username_0**: I looked at that one, but we need line item info and it appeared it does not offer that detail.  
  
  ---
  
  