定制 howtomakeaturn/pdfinfo 二次开发

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

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

howtomakeaturn/pdfinfo

最新稳定版本:1.1.6

Composer 安装命令:

composer require howtomakeaturn/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

统计信息

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

GitHub 信息

  • Stars: 67
  • Watchers: 3
  • Forks: 24
  • 开发语言: PHP

其他信息

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

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固