Metropolis
Metropolis

Reputation: 6622

Is it possible to dynamically merge one PDF with another using dompdf?

I am trying to take the raw data from a previously made PDF, and append it to a new PDF using DOMPDF. Is this possible?

Thanks for any help,
Metropolis

Upvotes: 1

Views: 5341

Answers (2)

Farhan Salam
Farhan Salam

Reputation: 1505

if it helps someone else, what I did, I concatenated the HTML string in a loop and then made a pdf file after the loop. And ofcourse using page-break-after: always; which creates a new page.

Upvotes: 0

BrianS
BrianS

Reputation: 13944

Are you talking about overlaying one PDF on top of another or appending the pages of one document to another? DOMPDF doesn't currently support either type of functionality because it is focused on HTML to PDF conversion. Due to this focus by the project you're not likely to see any work put in to support the handling of existing PDFs anytime soon.

This doesn't help for your current project, but you might post a feature request to add support for a library that is capable of performing a merge (I think FPDI may work). DOMPDF relies on third-party PDF rendering engines for creation of the actual PDF. A modified version of the CPDF library is included with DOMPDF, but there's no reason other rendering engines couldn't be supported.

Upvotes: 1

Related Questions