定制 softplaceweb/laravel-10-pdf-merger 二次开发

按需修改功能、优化性能、对接业务系统,提供一站式技术支持

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

softplaceweb/laravel-10-pdf-merger

最新稳定版本:1.1.9

Composer 安装命令:

composer require softplaceweb/laravel-10-pdf-merger

包简介

Laravel Pdf Merger

README 文档

README

Latest Stable Version Total Downloads Latest Unstable Version License

A simple Laravel service provider with some basic configuration for including the TCPDF library to allow you to merge PDF's in your Laravel application.

Compatibility from 1.3 to 1.7 versions, if attempt to merge version greater than 1.4 it convert through Ghosthscript.

The final result is a merged pdf file v 1.7

Requirements

  • PHP 8.0+
  • Ghostscript (gs command on Linux)

Installation

The Laravel PDF Merger service provider can be installed via composer by requiring the softplaceweb/laravel-10-pdf-merger package in your project's composer.json.

composer require softplaceweb/laravel-10-pdf-merger 

for lumen, you should add the following lines:

$app->register(Softplaceweb\PdfMerger\PdfMergerServiceProvider::class); class_alias(Softplaceweb\PdfMerger\Facades\TCPDF::class, 'PDF');

That's it! You're good to go.

Here is a little example:

use Softplaceweb\PdfMerger\Facades\PdfMerger; PdfMerger::addPDF('path/to/pdf1.pdf', 1) ->addPDF('path/to/pdf2.pdf', 'all') ->merge() ->save('new_file_name.pdf', 'browser');

or sending pdf's as array ...

use Softplaceweb\PdfMerger\Facades\PdfMerger; PdfMerger::addPDF([ [ 'filePath' => 'path/to/pdf1.pdf', 'pages' => 1, ], [ 'filePath' => 'path/to/pdf2.pdf', ], ]) ->merge() ->save('new_file_name.pdf', 'browser');

You can extend functionality for this class and for a list of all available function take a look at the TCPDF Documentation

Configuration

Laravel Pdf Merger comes with some basic configuration. If you want to override the defaults, you can publish the config, like so:

php artisan vendor:publish --provider="Softplaceweb\PdfMerger\PdfMergerServiceProvider" 

Now access config/pdf-merger.php to customize.

  • use_original_header is to used the original Header() from TCPDF.
    • Please note that PdfMerger::setHeaderCallback(function($pdf){}) overrides this settings.
  • use_original_footer is to used the original Footer() from TCPDF.
    • Please note that PdfMerger::setFooterCallback(function($pdf){}) overrides this settings.

Credits

统计信息

  • 总下载量: 1.45k
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 2
  • 点击次数: 4
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 2
  • Watchers: 0
  • Forks: 1
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2026-01-04

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固