Pop\Pdf\Pdf::__construct PHP Method

__construct() public method

Instantiate a PDF file object based on either a pre-existing PDF file on disk, or a new PDF file. Arguments may be passed to add a page upon instantiation. The PDF file exists, it and all of its assets will be imported.
public __construct ( string $pdf, string $sz = null, integer $w = null, integer $h = null ) : Pdf
$pdf string
$sz string
$w integer
$h integer
return Pdf
    public function __construct($pdf, $sz = null, $w = null, $h = null)
    {
        $this->fillColor = new \Pop\Color\Space\Rgb(0, 0, 0);
        $this->backgroundColor = new \Pop\Color\Space\Rgb(255, 255, 255);
        parent::__construct($pdf);
        $this->objects[1] = new Object\Root();
        $this->objects[2] = new Object\ParentObject();
        $this->objects[3] = new Object\Info();
        // If the PDF file already exists, import it.
        if ($this->size != 0) {
            $this->import($this->fullpath);
        }
        // If page parameters were passed, add a new page.
        if (null !== $sz || null !== $w && null !== $h) {
            $this->addPage($sz, $w, $h);
        }
    }