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-12-21 20:14:15 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();
  }
}