PHP Class iio\libmergepdf\Merger

Show file Open project: iio/libmergepdf Class Usage Examples

Public Methods

Method Description
__construct ( FPDI $fpdi = null ) Constructor
addFinder ( Finder $finder ) : void Add files using symfony finder
addFromFile ( string $fname, iio\libmergepdf\Pages $pages = null, boolean $cleanup = false ) : void Add PDF from filesystem path
addIterator ( array | Traversable $iterator ) : void Add files using iterator
addRaw ( string $pdf, iio\libmergepdf\Pages $pages = null ) : void Add raw PDF from string
getTempDir ( ) : string Get directory path for temporary files
getTempFname ( ) : string Create temporary file and return name
merge ( ) : string Merges your provided PDFs and get raw string
setTempDir ( string $dirname ) : void Set directory path for temporary files

Method Details

__construct() public method

Constructor
public __construct ( FPDI $fpdi = null )
$fpdi FPDI

addFinder() public method

Add files using symfony finder
public addFinder ( Finder $finder ) : void
$finder Symfony\Component\Finder\Finder
return void

addFromFile() public method

Note that your PDFs are merged in the order that you add them
public addFromFile ( string $fname, iio\libmergepdf\Pages $pages = null, boolean $cleanup = false ) : void
$fname string Name of file to add
$pages iio\libmergepdf\Pages Pages to add from file
$cleanup boolean Flag if file should be deleted after merging
return void

addIterator() public method

Add files using iterator
public addIterator ( array | Traversable $iterator ) : void
$iterator array | Traversable
return void

addRaw() public method

Note that your PDFs are merged in the order that you add them
public addRaw ( string $pdf, iio\libmergepdf\Pages $pages = null ) : void
$pdf string
$pages iio\libmergepdf\Pages
return void

getTempDir() public method

Set path using setTempDir(), defaults to sys_get_temp_dir().
public getTempDir ( ) : string
return string

getTempFname() public method

Create temporary file and return name
public getTempFname ( ) : string
return string

merge() public method

Merges your provided PDFs and get raw string
public merge ( ) : string
return string

setTempDir() public method

Set directory path for temporary files
public setTempDir ( string $dirname ) : void
$dirname string
return void