hubdesksa/pdf-merge

PHP PDF Merger 的分支

2.0.1 2020-11-24 06:58 UTC

This package is not auto-updated.

Last update: 2024-09-26 00:11:02 UTC


README

PHP PDF 合并库。

使用 composer 安装

composer require hubdesksa/pdf-merge

应添加依赖项

"hubdesksa/pdf-merge": "^2.0"

亮点

支持纵向/横向模式的 PDF 合并。

用法

// Autoload composer classses...

// and now we can use library
$pdf = new \Jurosh\PDFMerge\PDFMerger;

// add as many pdfs as you want
$pdf->addPDF('path/to/source/file.pdf', 'all', 'vertical')
  ->addPDF('path/to/source/file1.pdf', 'all')
  ->addPDF('path/to/source/file2.pdf', 'all', 'horizontal');

// call merge, output format `file`
$pdf->merge('file', 'path/to/export/dir/file.pdf');

就这样!

享受它,如果喜欢请留下星标 :)