承接 sgh/pdfbox 相关项目开发

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

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

sgh/pdfbox

最新稳定版本:v1.0.0

Composer 安装命令:

composer require sgh/pdfbox

包简介

PHP5 wrapper for the Apache PdfBox ExtractText utility.

关键字:

README 文档

README

A PHP interface for the PdfBox ExtractText utility, useful to unit-test contents of generated PDFs.

Build Status Latest Stable Version Latest Unstable Version Total Downloads License

Requirements

  • PHP >=5.3 or HHVM
  • Java Runtime Environment
  • PdfBox JAR file
  • PHP needs permissions for shell execution

Install

To install with composer:

composer require sgh/pdfbox

Basic Usage

use SGH\PdfBox\PdfBox; //$pdf = GENERATED_PDF; $converter = new PdfBox; $converter->setPathToPdfBox('/usr/bin/pdfbox-app-1.7.0.jar'); $text = $converter->textFromPdfStream($pdf); $html = $converter->htmlFromPdfStream($pdf); $dom = $converter->domFromPdfStream($pdf);

If the source PDF is a file, use xxxFromPdfFile() instead xxxFromPdfStream() with the source path as parameter.

If you want to save the converted output to a file, specify the destination path as second parameter of the xxxFromPdfxxx() methods.

Advanced Usage

Convert a range of pages instead of the full document:

$converter->getOptions() ->setStartPage(2) ->setEndPage(5);

Ignore corrupt objects in the PDF:

$converter->getOptions() ->setForce(true);

Sort text:

$converter->getOptions() ->setSort(true);

PHPUnit tests

To run the unit tests, change the environment variable PDFBOX_JAR to the full path of your PdfBox JAR file. See phpunit.xml.dist.

统计信息

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

GitHub 信息

  • Stars: 20
  • Watchers: 4
  • Forks: 8
  • 开发语言: PHP

其他信息

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

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固