iio\libmergepdf\Merger::addFromFile PHP Method

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
    public function addFromFile($fname, Pages $pages = null, $cleanup = false)
    {
        assert('is_string($fname)');
        assert('is_bool($cleanup)');
        if (!is_file($fname) || !is_readable($fname)) {
            throw new Exception("'{$fname}' is not a valid file");
        }
        if (!$pages) {
            $pages = new Pages();
        }
        $this->files[] = array($fname, $pages, $cleanup);
    }