gabrielchavezme/pdf-table-of-content
Composer 安装命令:
composer require gabrielchavezme/pdf-table-of-content
包简介
README 文档
README
Pdf Merge & table of content Solution for PHP and Laravel
This package is a wrapper for the TCPDF class that provides an elegant API for merging PDF files and returns a table of contents with bookmarks.
This library is based on the source code of: karriereat/pdf-merge
The same code structure was used and the functionality was added to make a bookmark in each added document, later it returns an array with the document's table of contents in order to render it in a JS engine on the frontend side.
Installation
You can install the package via composer:
composer require gabrielchavezme/pdf-table-of-content
Usage
$pdfMerge = new PdfTableOfContent(); $pdfMerge->add([ 'file' => '/path/to/file1.pdf', 'title' => 'File 1', 'id' => 1 ]); $pdfMerge->add([ 'file' => '/path/to/file2.pdf', 'title' => 'File 2', 'id' => 2 ]); $pdfMerge->merge('/path/to/output.pdf');
Please note, that the merge method will throw an NoFilesDefinedException if no files where added.
Check for file existence
You can check if a file was already added for merging by calling:
$pdfMerge->contains('/path/to/file.pdf');
License
Apache License 2.0 Please see LICENSE for more information.
统计信息
- 总下载量: 19
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 0
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: Apache-2.0
- 更新时间: 2021-07-10