Snip2Code is shutting down.
It has been quite a ride, since 2013 when we launched our first prototype: thanks to the effort of you guys we collected more than 3 million snippets!
We are very proud to help all our users to be more efficient in their jobs, and to be the central point to share programming knowledge for everyone.
Our basic service is free, so we always survived on our own resources to give you Snip2Code.
Unfortunately, we are no more in the financial position to sustain this effort, and therefore we are announcing here our permanent shut down,
which will take place on August 1st, 2020.
Please save your private snippets using our backup function in the settings, here.
This will allow us to pay for the servers and the infrastructure. If you want to donate, Contact Us!
426 16

Merge multiple PDFs using PHP SDK from Aspose

PHP developers can learn how to merge multiple PDF files into a single PDF file using PHP SDK from Aspose. You can use the following given supported third party storage to access Aspose for Cloud service.

In order to use PHP SDK, you need to perform following steps:

-	Set base product URI, App SID, App Key and output location. See section 1 of the complete code.
-	Upload input PDF files. See section 2 of the complete code.
-	Create object of Document class and call mergeDocuments method passing array of names (including paths) of input PDF files. See section 3 of the complete code.
-	Download merged PDF file. See Download a Particular File example for more details.
Copy Embed Code
<iframe id="embedFrame" style="width:600px; height:300px;"
Click on the embed code to copy it into your clipboard Width Height
Leave empty to retrieve all the content Start End
use Aspose\Cloud\Common\AsposeApp; use Aspose\Cloud\Common\Utils; use Aspose\Cloud\Common\Product; use Aspose\Cloud\Storage\Folder; use Aspose\Cloud\Pdf\Document; /**** Section 1 ****/ AsposeApp::$appSID = "77****-****-****-****-80*********"; AsposeApp::$appKey = "******************"; $baseProductUri= ""; AsposeApp::$outPutLocation = getcwd() . "/Output/"; /**** End Section 1 ****/ /**** Section 2 ****/ $inputFile1 = getcwd() . "/Input/input1.pdf"; $inputFile2 = getcwd() . "/Input/input2.pdf"; $inputFile3 = getcwd() . "/Input/input3.pdf"; $mergedFileName = "MergedFile.pdf"; //upload input PDF files echo "Uploading main document...<br />"; $folder = new Folder(); $folder->UploadFile($inputFile1, ""); $folder->UploadFile($inputFile2, ""); $folder->UploadFile($inputFile3, ""); echo "input files uploaded <br />"; /**** End Section 2 ****/ /**** Section 3 ****/ echo "Merging PDF files... <br />"; //create Document object $doc = new Document($mergedFileName); $result = $doc->mergeDocuments(array('input1.pdf','input2.pdf','input3.pdf')); /**** End Section 3 ****/
If you want to be updated about similar snippets, Sign in and follow our Channels

blog comments powered by Disqus