Merge Pdfs in workflow //

Is it possible to generate 2 Pdf files and merge them together into one?

Need this cause its not possible to stop headers from beeing printed on the first page of the generated multiple page pdf . (First page need an different header than the other ones).

If someone could help with one of the problems i would appreciate it .

thx JJ.

Unfortunately not nativelly with workflows; I’ll open some tickets to see what we could do in regards to this.

In the mean time, here are two options I can think of:

  • Define two sepparate templates, one for the first page and one for the rest. Render the two templates sepparately and store them in sepparate fields.
  • Call an automation script in which you would implement the PDF merging (there is probably an NPM package that does this) – ref
1 Like

Solved it. I didnt merged it.
After my content on the first page i forced a pagebreak and created an section with header tag.(The Header will just appear in the defined section on each page).

Maybe not the best solution but it worked for me. But merging would be a nice feature :blush:

Would you mind sharing a sample of the template that achieves the given result in case someone else is looking for a similar solution?
In the future, we’ll probably expand what the current version of conditional rendering can achieve for more dynamic options.

1 Like

I cant share the template itself, but here is a quick example:

HTML:

    <html>
         <head>
            //Example
         </head>
    <body>
    # Here could be your content of page 1
    # I designed the first header without a header tag. but i think u can do it the same way as below
    
    # Forced PageBreak
    <div style='page-break-before: always;'> </div>
    
    #---- Second Page of the template -----
    <section>
    #(even over multiple pages) the header will be displayed inside this section . 
    # some css will be needed to align it the way you want. I deleted mine so we have a clean example.
      <header style="position:fixed;">
        <div>
          <span>
             # Header Content
          </span>
        </div>
      </header>

    #Content Page 2
    </section>


    </body>
    </html>

At least pretty simple, but it took hours to find out. Hope it will be useful :slight_smile:

JJ :space_invader:

2 Likes