karriere/pdf-merge 问题修复 & 功能扩展

解决BUG、新增功能、兼容多环境部署,快速响应你的开发需求

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

karriere/pdf-merge

最新稳定版本:v3.4.0

Composer 安装命令:

composer require karriere/pdf-merge

包简介

A wrapper for the TCPDF class that provides an elegant API for merging PDFs

关键字:

README 文档

README

    Packagist Downloads

Pdf Merge Solution for PHP

This package is a wrapper for the TCPDF class that provides an elegant API for merging PDF files.

Installation

You can install the package via composer:

composer require karriere/pdf-merge

Usage

use Karriere\PdfMerge\PdfMerge;

$pdfMerge = new PdfMerge();

$pdfMerge->add('/path/to/file1.pdf');
$pdfMerge->add('/path/to/file2.pdf');

$pdfMerge->merge('/path/to/output.pdf');

Please note, that the merge()-method will throw a 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');

Configuring header and footer

You can also configure the header of footer of all pages like this:

use Karriere\PdfMerge\PdfMerge;

$pdfMerge = new PdfMerge(
        new HeaderConfig(
            imagePath: 'header_logo.png',
            logoWidthMM: 20,
            title: 'Header',
            text: 'This is a header text',
            textColor: new RGB(200, 200, 200),
            lineColor: new RGB(0, 0, 255),
        ),
        new FooterConfig(
            textColor: new RGB(100, 100, 100),
            lineColor: new RGB(255, 0, 0),
            margin: 20,
        ),
    );

All config properties have default values, so you don't have to pass them all.

License

Apache License 2.0 Please see LICENSE for more information.

统计信息

  • 总下载量: 493.35k
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 27
  • 点击次数: 1
  • 依赖项目数: 1
  • 推荐数: 0

GitHub 信息

  • Stars: 27
  • Watchers: 3
  • Forks: 10
  • 开发语言: PHP

其他信息

  • 授权协议: Apache-2.0
  • 更新时间: 2020-03-24