Macejkou
Macejkou

Reputation: 686

How to merge multiple PDF files to one one-page PDF in PHP

I have a bulk of small pdf files of bar-code labels. Lets say 1/4 of A4 each. What I want to do is to merge them all together so I have 4 labels per page (labels stacked 2x2 on one page). So I can print them all at once.

Is it possible to combine pdf files like this in PHP? There are some PDF merge libraries out there but all examples are adding/removing whole pages.

Do you have any experience with this?

Upvotes: 2

Views: 17774

Answers (2)

Jan Slabon
Jan Slabon

Reputation: 5058

You can do this with FPDF and FPDI. A good demo to start is available here. You just have to remove the drawing of borders and offsets.

Upvotes: 1

paranoid
paranoid

Reputation: 7115

Ues fpdf class in your project.
fpdf
this post can help you to solve your problam
merge-pdf-files-with-php

Upvotes: 0

Related Questions