承接 warlog7997/pdfsplit 相关项目开发

从需求分析到上线部署,全程专人跟进,保证项目质量与交付效率

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

warlog7997/pdfsplit

Composer 安装命令:

composer require warlog7997/pdfsplit

包简介

Pure PHP library for PDF splitting, page extraction, and merging. No external dependencies.

README 文档

README

Latest Stable Version Total Downloads License PHP Version

A pure PHP library for PDF page extraction, splitting, and merging — no external dependencies, no ImageMagick, no GhostScript.

Handles all modern PDF formats including PDF 1.5+ xref streams, ObjStm compressed objects, FlateDecode with PNG predictor, and incremental updates.

Requirements

  • PHP 8.0+
  • ext-zlib

Installation

composer require warlog7997/pdfsplit

Usage

Split every page into individual PDFs

use Subash\PhpPdf\PhpPdf;

// Save to directory — produces page_1.pdf, page_2.pdf, ...
PhpPdf::load('document.pdf')
    ->splitter()
    ->splitToDirectory('/output/dir/');

// Or get binary strings (store in DB, upload to S3, etc.)
$pages = PhpPdf::load('document.pdf')
    ->splitter()
    ->split();
// [1 => '<pdf binary>', 2 => '<pdf binary>', ...]

Extract specific pages

// Extract pages 1 and 3
$pdfBinary = PhpPdf::load('document.pdf')->extract([1, 3]);
file_put_contents('extracted.pdf', $pdfBinary);

Extract a page range

// Extract pages 1 through 5
$pdfBinary = PhpPdf::load('document.pdf')->extractRange(1, 5);
file_put_contents('pages1to5.pdf', $pdfBinary);

Merge multiple PDFs

PhpPdf::merger()
    ->add('file1.pdf')
    ->add('file2.pdf')
    ->save('merged.pdf');

Load from binary string

$pdfBinary = file_get_contents('document.pdf');
$pdf = PhpPdf::loadData($pdfBinary);
echo $pdf->getPageCount();

Supported PDF features

Feature Supported
Traditional xref tables (PDF 1.1–1.4)
Xref streams (PDF 1.5+)
ObjStm compressed objects (Type 2)
FlateDecode + PNG predictor
Incremental updates (/Prev chain)
Large files / large objects
Encrypted / password-protected PDFs

License

MIT

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: MIT
  • 更新时间: 2026-07-09

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固