Answers.Body: <p>You're correct that it's wkhtmltopdf although I don't necessarily think it's a bug. The <code>position: absolute</code> is causing wkthmltopdf to position everything relative to (0,0) on the first page, whereas with dompdf it inserts a new page regardless.</p>
  <p>If you use <code>relative</code> it works, but depending on what your body content looks like you may have to adjust.</p>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2022-02-22T12:40:27.483Z
Answers.Text: Thank you so much! You are absolutely right and this fixed the problem.
Answers.UserDisplayName: jrock
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2022-02-17T15:06:03.890Z
Answers.LastActivityDate: 2022-02-17T15:06:03.890Z
Answers.UserDisplayName: Demerit
Body: <p>I am trying to create a template for a Donation-Thank-You letter for one of our clients. So far so good and it works and looks fine if you print one letter at a time.
  Of course, to be efficient, our client would like to be able to print multiple letters at the same time addressed to multiple different contacts.
  This is where I ran into a road block which I have not been able to find a solution for anywhere: If I select multiple contacts for which I would like to generate a pdf from my template, they get printed on top of each other, I can tell from the names being written over each other.</p>
  <p>I discovered that when I remove the rel=&quot;stylesheet&quot; attribute from my <code>&lt;link/&gt;</code> tag it will print the individual documents but the css is obviously missing since I removed the rel=&quot;stylesheet&quot;.
  I have a strong suspicion it has something to do with wkhtmltopdf which renders the template but, like I said, I have not been able to find a solution.</p>
  <p>My goal is to be able to print multiple, individual documents for multiple contacts at once and have my css work.
  Has anyone run in a similar issue and solved it? Or does anyone know what else I could look for?</p>
  <p>Edit to add CSS:</p>
  <pre><code>&lt;style&gt;
  
  {literal}
  
     @font-face {
       font-family: 'Montserrat';
       src: url('https://test.site.org/Montserrat-Regular.otf') format('opentype');
       font-weight: regular;
     }
  
     @font-face {
       font-family: 'pt-serif';
       src: url('https://test.site.org/fonts/pt-serif/PTF55F.ttf') format('truetype');
       font-weight: regular;
     }
  
     * {
       font-size: .97em;
       font-family: pt-serif;
     }
  
     th {
         font-weight: bold;
     }
  
     .logo {
         position: absolute;
         right: 100px;
         top:20px;
     }
  
     .Impressum {
         vertical-align: top;
         position: absolute;
         left: 385px;
         font-family: Montserrat;
         font-size: 0.75em;
         padding-top:120px;
     }
  
     .invisible {
         display: none;
     }
  
     .Absender {
           position: absolute;
           top:125px;
           left: 20px;
           font-size: 0.65em;
           font-family: Montserrat;
     }
  
     .Empfaenger {
         position: absolute;
         top:145px;
         left: 20px;
         vertical-align: top;
         font-size:0.9em;
         width:350px;
         font-family: Montserrat;
     }
  
     .intro {
         font-size: .97em;
         font-family: pt-serif;
         padding-bottom:12px;
     }
  
     .Rechnungsdatum {
         position: absolute;
         top:300px;
         right:95px;
         font-size: 0.9em;
         text-align: right;
         width:150px;
         font-family: pt-serif;
     }
  
     .Rechnungszweck {
         position: absolute;
         top:370px;
         left: 15px;
         font-size: 1.2em;
         width:100%;
         font-family: Montserrat;
     }
  
     .Content {
         position: absolute;
         top: 390px;
         left: 19px;
         font-size: 0.9em;
         font-family: pt-serif;
     }
  
     .footer {
         position: fixed;
         left: 0;
         bottom: -50px;
         width: 100%;
         font-family: Montserrat;
         font-size: 0.8em;
     }
  
     {
         /literal
     }
  &lt;/style&gt;
  </code></pre>
  <p><code>&lt;link/&gt;</code> tag to include the file in my template: <code>&lt;link rel=&quot;stylesheet&quot; href=&quot;/contacts.site.org/css/pdf.css&quot; type=&quot;text/css&quot; /&gt;</code></p>
  
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2022-02-16T17:08:33.710Z
Comments.Text: Can you show us the css? Or at least any part that might be relevant to pagination?
Comments.UserDisplayName: Demerit
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2022-02-16T18:10:16.070Z
Comments.Text: I added it in my post
Comments.UserDisplayName: jrock
Tags: <printmerge>
Title: Print/Merge document printed on top of each other
ThreadText: # Print/Merge document printed on top of each other
  
  (Asked by: username_0 on 2022-02-16)
  
  I am trying to create a template for a Donation-Thank-You letter for one of our clients. So far so good and it works and looks fine if you print one letter at a time.
  Of course, to be efficient, our client would like to be able to print multiple letters at the same time addressed to multiple different contacts.
  This is where I ran into a road block which I have not been able to find a solution for anywhere: If I select multiple contacts for which I would like to generate a pdf from my template, they get printed on top of each other, I can tell from the names being written over each other.
  
  I discovered that when I remove the rel="stylesheet" attribute from my `<link/>` tag it will print the individual documents but the css is obviously missing since I removed the rel="stylesheet".
  I have a strong suspicion it has something to do with wkhtmltopdf which renders the template but, like I said, I have not been able to find a solution.
  
  My goal is to be able to print multiple, individual documents for multiple contacts at once and have my css work.
  Has anyone run in a similar issue and solved it? Or does anyone know what else I could look for?
  
  Edit to add CSS:
  
  ```
  <style>
  
  {literal}
  
     @font-face {
       font-family: 'Montserrat';
       src: url('https://test.site.org/Montserrat-Regular.otf') format('opentype');
       font-weight: regular;
     }
  
     @font-face {
       font-family: 'pt-serif';
       src: url('https://test.site.org/fonts/pt-serif/PTF55F.ttf') format('truetype');
       font-weight: regular;
     }
  
     * {
       font-size: .97em;
       font-family: pt-serif;
     }
  
     th {
         font-weight: bold;
     }
  
     .logo {
         position: absolute;
         right: 100px;
         top:20px;
     }
  
     .Impressum {
         vertical-align: top;
         position: absolute;
         left: 385px;
         font-family: Montserrat;
         font-size: 0.75em;
         padding-top:120px;
     }
  
     .invisible {
         display: none;
     }
  
     .Absender {
           position: absolute;
           top:125px;
           left: 20px;
           font-size: 0.65em;
           font-family: Montserrat;
     }
  
     .Empfaenger {
         position: absolute;
         top:145px;
         left: 20px;
         vertical-align: top;
         font-size:0.9em;
         width:350px;
         font-family: Montserrat;
     }
  
     .intro {
         font-size: .97em;
         font-family: pt-serif;
         padding-bottom:12px;
     }
  
     .Rechnungsdatum {
         position: absolute;
         top:300px;
         right:95px;
         font-size: 0.9em;
         text-align: right;
         width:150px;
         font-family: pt-serif;
     }
  
     .Rechnungszweck {
         position: absolute;
         top:370px;
         left: 15px;
         font-size: 1.2em;
         width:100%;
         font-family: Montserrat;
     }
  
     .Content {
         position: absolute;
         top: 390px;
         left: 19px;
         font-size: 0.9em;
         font-family: pt-serif;
     }
  
     .footer {
         position: fixed;
         left: 0;
         bottom: -50px;
         width: 100%;
         font-family: Montserrat;
         font-size: 0.8em;
     }
  
     {
         /literal
     }
  </style>
  
  ```
  
  `<link/>` tag to include the file in my template: `<link rel="stylesheet" href="/contacts.site.org/css/pdf.css" type="text/css" />`
  
  **Tags:** printmerge
  
  > **Comments:**
  > **username_1**: Can you show us the css? Or at least any part that might be relevant to pagination?  
  > **username_0**: I added it in my post  
  
  ---
  
  ## 1 answers
  
  ### Answer by username_1 on 2022-02-17. Score: 3 | Accepted answer
  
  You're correct that it's wkhtmltopdf although I don't necessarily think it's a bug. The `position: absolute` is causing wkthmltopdf to position everything relative to (0,0) on the first page, whereas with dompdf it inserts a new page regardless.
  
  If you use `relative` it works, but depending on what your body content looks like you may have to adjust.
  
  > **Comments:**
  > **username_0**: Thank you so much! You are absolutely right and this fixed the problem.  
  
  ---
  
  