jrmc/pdfinfo
Composer 安装命令:
composer require jrmc/pdfinfo
包简介
simple php wrapper for pdfinfo
README 文档
README
Simple PHP wrapper to the pdfinfo unix tool.
Inspired by http://stackoverflow.com/questions/14644353/get-the-number-of-pages-in-a-pdf-document/14644354
What is pdfinfo
pdfinfo is an unix tool helping extract information from pdf files.
http://linuxcommand.org/man_pages/pdfinfo1.html
You can get page count, title, author..etc via the tool.
Installation
1. Install pdfinfo
First you need to have pdfinfo in your system.
For ubuntu, there's an easy way for doing this:
sudo apt-get install poppler-utils
2. Install the library
You can just download the file to your project, or install it via composer:
composer require "howtomakeaturn/pdfinfo:1.*"
Usage
Just pass the path to the pdf file to the constructor, and you can get metadata from its properties immediately:
$pdf = new PDFInfo('path/to/the/pdf'); echo $pdf->title; // Get the title echo $pdf->pages; // Get the number of pages
Exceptions
This library throws 4 kind of exceptions to represent the official exit codes.
- OpenPDFException
- OpenOutputException
- PDFPermissionException
- OtherException
Check the official documentation for more information.
Reference
Currently this library supports the following metadata:
- title
- author
- creator
- producer
- creationDate
- modDate
- tagged
- form
- pages
- encrypted
- pageSize
- fileSize
- optimized
- PDFVersion
- pageRot
jrmc/pdfinfo 适用场景与选型建议
jrmc/pdfinfo 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 6.85k 次下载、GitHub Stars 达 0, 最近一次更新时间为 2019 年 11 月 21 日, 在 PHP 生态内属于活跃度较高的组件。
它主要适用于以下技术方向: 「pdf」 「pdfinfo」 等业务场景。在实际项目中,围绕这些方向常见需要落地的问题包括:接口对接、性能调优、并发安全、与既有框架(Laravel / ThinkPHP / Yii / Webman 等)的兼容适配,以及生产环境的日志埋点与稳定性保障。
我们在过去多个企业项目中使用过 jrmc/pdfinfo 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 jrmc/pdfinfo 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
与 jrmc/pdfinfo 相关的其它包
同方向 / 同关键字的高下载量 PHP Composer 包推荐,方便对比选型:
simple php wrapper for pdfinfo
A little PHP wrapper around the Xpdf cli tool: pdfinfo.
Provides TCPDF integration for Symfony
Parse pdfinfo from shell to php 5.6+
A simple PHP library that makes rasterizing pages and extracting text from PDFs for large language models easy
A adapter for the mPDF print library
统计信息
- 总下载量: 6.85k
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 13
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2019-11-21