phpdftk API Documentation

PageSelector
in package

FinalYes

Selects which pages an operation applies to.

Used by PdfStamper, AnnotationFlattener, PageTransformer, TextRedactor, etc. Page numbers are 1-based throughout the toolkit API.

Table of Contents

Methods

all()  : self
even()  : self
matches()  : bool
Check if a page number matches this selector.
odd()  : self
pages()  : self
range()  : self
resolve()  : array<int, int>
Resolve matching page indices (0-based) for a document.

Methods

matches()

Check if a page number matches this selector.

public matches(int $pageNumber, int $totalPages) : bool
Parameters
$pageNumber : int

1-based page number

$totalPages : int

Total pages in the document

Return values
bool

pages()

public static pages(int ...$pageNumbers) : self
Parameters
$pageNumbers : int
Return values
self

range()

public static range(int $from, int $to) : self
Parameters
$from : int
$to : int
Return values
self

resolve()

Resolve matching page indices (0-based) for a document.

public resolve(int $totalPages) : array<int, int>
Parameters
$totalPages : int
Return values
array<int, int>

0-based page indices


        
On this page

Search results