PHP code example of natuelabs / danphpe

1. Go to this page and download the library: Download natuelabs/danphpe library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

natuelabs / danphpe example snippets




on = 'us-east-1';
$environment = 'development';
$credentials = [
  'key' => '',
  'secret' => '',
];
$bucket = 'your.bucket';

$reader = new Natuelabs\Danphpe\Reader\S3($region, $environment, $credentials, $bucket);

$storage = new Natuelabs\Danphpe\Storage\FileSystem('/tmp');

$storage->save(
  'merged.pdf',
  Natuelabs\Danphpe\PDF\merge([
    Natuelabs\Danphpe\PDF\merge\raw($reader->getContents('3218021701809100027655020000375281000000020.pdf')),
    Natuelabs\Danphpe\PDF\merge\raw($reader->getContents('3218021701809100027655020000375291000000036.pdf')),
    Natuelabs\Danphpe\PDF\merge\raw($reader->getContents('3218021701809100027655020000375301000000045.pdf'))
  ])
);