public function getBoundary($box = PageBoundaries::CROP_BOX, $fallback = true)
    {
        $value = $this->getAttribute($box);

        if ($value !== null) {
            return Rectangle::byPdfArray($value, $this->parser);
        }

        if ($fallback === false) {
            return false;
        }

        switch ($box) {
            case PageBoundaries::BLEED_BOX:
            case PageBoundaries::TRIM_BOX:
            case PageBoundaries::ART_BOX:
                return $this->getBoundary(PageBoundaries::CROP_BOX, true);
            case PageBoundaries::CROP_BOX:
                return $this->getBoundary(PageBoundaries::MEDIA_BOX, true);
        }

        return false;
    }
public function getBoundary($box = PageBoundaries::CROP_BOX, $fallback = true)
    {
        $value = $this->getAttribute($box);

        if ($value !== null) {
            return Rectangle::byPdfArray($value, $this->parser);
        }

        if ($fallback === false) {
            return false;
        }

        switch ($box) {
            case PageBoundaries::BLEED_BOX:
            case PageBoundaries::TRIM_BOX:
            case PageBoundaries::ART_BOX:
                return $this->getBoundary(PageBoundaries::CROP_BOX, true);
            case PageBoundaries::CROP_BOX:
                return $this->getBoundary(PageBoundaries::MEDIA_BOX, true);
        }

        return false;
    }
public function getBoundary ( $ box = PageBoundaries :: CROP_BOX , $ fallback = true ) { $ value = $ this -> getAttribute ( $ box ) ; if ( $ value !== null ) { return Rectangle :: byPdfArray ( $ value , $ this -> parser ) ; } if ( $ fallback === false ) { return false ; } switch ( $ box ) { case PageBoundaries :: BLEED_BOX : case PageBoundaries :: TRIM_BOX : case PageBoundaries :: ART_BOX : return $ this -> getBoundary ( PageBoundaries :: CROP_BOX , true ) ; case PageBoundaries :: CROP_BOX : return $ this -> getBoundary ( PageBoundaries :: MEDIA_BOX , true ) ; } return false ; }
Get a boundary of this page.

@param string $box
@param bool $fallback
@return bool|Rectangle
@throws PdfParserException
@throws PdfTypeException
@throws CrossReferenceException
@see PageBoundaries
Get a boundary of this page .