simple php wrapper for pdfinfo

1.1.4 2019-01-10 02:45 UTC

This package is auto-updated.

Last update: 2022-01-10 14:35:00 UTC


Simple PHP wrapper to the pdfinfo unix tool.

Inspired by

What is pdfinfo

pdfinfo is an unix tool helping extract information from pdf files.

You can get page count, title, author..etc via the tool.


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.*"


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


This library throws 4 kind of exceptions to represent the official exit codes.

  • OpenPDFException
  • OpenOutputException
  • PDFPermissionException
  • OtherException

Check the official documentation for more information.


Currently this library supports the following metadata:

  • title
  • author
  • creator
  • producer
  • creationDate
  • modDate
  • tagged
  • form
  • pages
  • encrypted
  • pageSize
  • fileSize
  • optimized
  • PDFVersion
  • pageRot