PDF tool for showing information and PDF actions like separation.

v0.3.0 2019-08-09 12:30 UTC

This package is auto-updated.

Last update: 2024-05-10 00:18:00 UTC


README

Requirements

This library depends on poppler utils which can be installed by the following.

Debian / Ubuntu

apt install poppler-utils
apt install ghostscript

OSX

brew install poppler

Installation

composer require 3ws-internet-oplossingen/pdf-tools

Usage of the package

Info

Gather all information about a PDF file like Page count.

$pdf = new ThreeWS\PdfTools\Info('location_to_pdf.pdf');
var_dump($pdf->toArray());

Jpg

Convert a PDF page to a JPG file.

$pdf = new ThreeWS\PdfTools\Jpg('location_to_pdf.pdf', 60, 'y');
var_dump($pdf->convert());

Separate

Convert a PDF file with multiple pages into multiple single page PDF's using a pattern with replacement of %d.

$pdf = new ThreeWS\PdfTools\Separate('location_to_pdf.pdf', 'location_to_paged_%d_pdf.pdf');

Text

Extract Text from a PDF file.

$pdf = new ThreeWS\PdfTools\Text('location_to_pdf.pdf');
var_dump($pdf->convert());