Guide 18 - "Merge" of PDFS files |
6/16/2021 12:00:22 PM |
PHPRunner Tips and Tricks | |
![]() I have seen in the PHPrunner forum that there was a certain need to "mix" pdf's file pages and as I saw that it is simple subject to solve and given the interest it awaken, I have created an example that happened to describe. Objective This example should be used to make "merge" of PDF's files DEMO: https://fhumanes.com/pdfMerge/ All the details and the source code on my portal: https://fhumanes.com/blog/guias-desarrollo/guia-18-phprunner-merge-de-ficheros-pdfs/ |
|
![]() |
fhumanes author 6/16/2021 |
Technical solutionTo make this management with the PDF files I downloaded and used this github library: https://github.com/cogginabox/pdf-merger In turn, this library is based on the products I have used to dynamically generate the PDF files of the multiple examples that exist in the portal.
In the documentation of the library this example of use is provided: $pdf = new \Clegginabox\PDFMerger\PDFMerger; Actually, it is very simple, fast and practical, the solution that gives us. To have a functional example, I have defined the following requirements:
The application interface is:
On the "pdfMerge" button, the commands that are defined in the "Command" field are executed. The syntax is very simple and everything has been adjusted to the library command that has previously been shown. In the example I have not dedicated a lot of time to the syntactic analysis of this nomenclature, so if it is not exact, it is possible that it does not do anything or error. To make new tests, please create new record with your own PDF's files The most important thing is the coding of the use of the library and that is "pdfMerge.php": <?php For any questions or need, contact me via email fernandohumanes@gmail.com I leave the project (PHPRunner 10.2) so you can deploy it on your PCs. Recodting that you must update the sample record with your own PDF's files. |