class pdftk_adapter

Infrastructure service to handle PDF manipulations using PDFTk.

Wrapper around mikehaertl/php-pdftk.

Methods

static bool
is_available()

Check if PDFTk is available and executable.

static Pdf
get_instance(array|string|null $pdf_path = null)

Get a configured instance of the PDFTk wrapper.

static string
uncompress_content(string $content)

Uncompress a PDF file stream.

Details

at line 38
static bool is_available()

Check if PDFTk is available and executable.

Return Value

bool

at line 52
static Pdf get_instance(array|string|null $pdf_path = null)

Get a configured instance of the PDFTk wrapper.

Parameters

array|string|null $pdf_path

path to PDF file or array of paths

Return Value

Pdf

Exceptions

RuntimeException

at line 78
static string uncompress_content(string $content)

Uncompress a PDF file stream.

Useful for parsing PDF content.

Parameters

string $content

Raw PDF content

Return Value

string

Uncompressed PDF content

Exceptions

Exception