tigron/skeleton-file-pdf

Tigron PDF utilities

v0.2.8 2021-01-21 10:35 UTC

This package is auto-updated.

Last update: 2024-04-10 23:47:13 UTC


README

Description

This library adds PDF edit functionality for Skeleton\File\File objects

Installation

Installation via composer:

composer require tigron/skeleton-file-pdf

Howto

Get a PDF

$file = \Skeleton\File\File::get_by_id(1);

Check if the file is a PDF

if (!$file->is_pdf()) {
	return;
}

Count the number of pages in the PDF

$page_count = $file->count_pages();

Extract all pages from a PDF

$pages = $file->extract_pages();

Merge different PDF documents into 1 PDF

$new_pdf = \Skeleton\File\Pdf\Pdf::merge('new_document.pdf', array_reverse($pages));

Append a page to the PDF

$new_pdf->append(array_shift($pages));

Rotate the pages of a PDF document (degrees clockwise)

$pdf->rotate(90)