aleswita/pdfmerger

PDF Merger for Nette Framework and Ghost Script.

1.0 2017-02-03 06:19 UTC

This package is not auto-updated.

Last update: 2024-11-09 19:40:44 UTC


README

PdfMerger for Nette Framework and Ghost Script.

Installation

The best way to install AlesWita/PdfMerger is using Composer:

$ composer require aleswita/pdfmerger:dev-master

Usage

Configuration

extensions:
  pdfmerger: AlesWita\PdfMergerExtension
	
pdfmerger:
  program: "\"C:\\Program Files\\gs\\gs9.19\\bin\\gswin64c.exe\""

Presenter

use AlesWita;

final class HomePresenter extends BasePresenter
{
  /** @var AlesWita\PdfMerger @inject */
  public $pdfMerger;

  ...
  
  public function handleMergePdf(array $files): void {
    foreach ($files as $file) {
      $this->pdfMerger->addPdf($file);
    }
  
    $this->pdfMerger->setOutputFile("test.pdf")
      ->merge();
  }
}