tigron/skeleton-file-pdf

Tigron PDF utilities

v0.2.9 2024-02-10 23:33 UTC

This package is auto-updated.

Last update: 2024-10-21 16:38:10 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)