2017 © Pedro Peláez
 

library lara-pdf-merger

image

daltcore/lara-pdf-merger

  • Tuesday, May 22, 2018
  • by RamonSmit
  • Repository
  • 2 Watchers
  • 0 Stars
  • 220 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 28 Forks
  • 0 Open issues
  • 3 Versions
  • 1058 % Grown

The README.md

lara-pdf-merger

Drop-in replacement for the original package from deltaaskii/lara-pdf-merger that also works under PHP 7.4, (*1)

Original written by http://pdfmerger.codeplex.com/team/view, (*2)

This Package was tested on Laravel 6.0, (*3)

Improvements

  • Code source refactoring
  • Enabling the Facade use
  • Adding duplex merge feature
  • Seperate save operation from the merge

Installation

  • Require this package in your composer.json by adding those lines
composer require daltcore/lara-pdf-merger
  • Run this commend in your terminal
composer update

Laravel <5.5:

After updating composer, add the ServiceProvider to the providers array in config/app.php, (*4)

    LynX39\LaraPdfMerger\PdfMergerServiceProvider::class,

You can optionally use the facade for shorter code. Add this to your facades:, (*5)

    'PdfMerger' => LynX39\LaraPdfMerger\Facades\PdfMerger::class,

Usage


use LynX39\LaraPdfMerger\Facades\PdfMerger; //... $pdfMerger = PDFMerger::init(); //Initialize the merger $pdfMerger->addPDF('samplepdfs/one.pdf', '1, 3, 4'); $pdfMerger->addPDF('samplepdfs/two.pdf', '1-2'); $pdfMerger->addPDF('samplepdfs/three.pdf', 'all'); //You can optionally specify a different orientation for each PDF $pdfMerger->addPDF('samplepdfs/one.pdf', '1, 3, 4', 'L'); $pdfMerger->addPDF('samplepdfs/two.pdf', '1-2', 'P'); $pdfMerger->merge(); //For a normal merge (No blank page added) // OR.. $pdfMerger->duplexMerge(); //Merges your provided PDFs and adds blank pages between documents as needed to allow duplex printing // optional parameter can be passed to the merge functions for orientation (P for protrait, L for Landscape). // This will be used for every PDF that doesn't have an orientation specified $pdfMerger->save("file_path.pdf"); // OR... $pdfMerger->save("file_name.pdf", "download"); // REPLACE 'download' WITH 'browser', 'download', 'string', or 'file' for output options

Authors

Credits

The Versions

22/05 2018

dev-master

9999999-dev https://github.com/daltcore/lara-pdf-merger

  Sources   Download

MIT

The Requires

  • php >=5.4

 

laravel merge manage pdf paginate merger

22/05 2018

v1.1.0

1.1.0.0 https://github.com/daltcore/lara-pdf-merger

  Sources   Download

MIT

The Requires

  • php >=5.4

 

laravel merge manage pdf paginate merger

17/11 2017

v1.0.0

1.0.0.0 https://github.com/LynX39/lara-pdf-merger

  Sources   Download

MIT

The Requires

  • php >=5.4

 

laravel merge manage pdf paginate merger