src/Smalot/PdfParser/Page.php
public function getXObjects()
    {
        if (!is_null($this->xobjects)) {
            return $this->xobjects;
        }

        $resources = $this->get('Resources');

        if (method_exists($resources, 'has') && $resources->has('XObject')) {

            if ($resources->get('XObject') instanceof Header) {
                $xobjects = $resources->get('XObject')->getElements();
            } else {
                $xobjects = $resources->get('XObject')->getHeader()->getElements();
            }

            $table = array();

            foreach ($xobjects as $id => $xobject) {
                $table[$id] = $xobject;

                // Store too on cleaned id value (only numeric)
                $id = preg_replace('/[^0-9\.\-_]/', '', $id);
                if ($id != '') {
                    $table[$id] = $xobject;
                }
            }

            return ($this->xobjects = $table);
        } else {
            return array();
        }
    }
public function getXObjects()
    {
        if (!is_null($this->xobjects)) {
            return $this->xobjects;
        }

        $resources = $this->get('Resources');

        if (method_exists($resources, 'has') && $resources->has('XObject')) {

            if ($resources->get('XObject') instanceof Header) {
                $xobjects = $resources->get('XObject')->getElements();
            } else {
                $xobjects = $resources->get('XObject')->getHeader()->getElements();
            }

            $table = array();

            foreach ($xobjects as $id => $xobject) {
                $table[$id] = $xobject;

                // Store too on cleaned id value (only numeric)
                $id = preg_replace('/[^0-9\.\-_]/', '', $id);
                if ($id != '') {
                    $table[$id] = $xobject;
                }
            }

            return ($this->xobjects = $table);
        } else {
            return array();
        }
    }
public function getXObjects ( ) { if ( ! is_null ( $ this -> xobjects ) ) { return $ this -> xobjects ; } $ resources = $ this -> get ( 'Resources' ) ; if ( method_exists ( $ resources , 'has' ) && $ resources -> has ( 'XObject' ) ) { if ( $ resources -> get ( 'XObject' ) instanceof Header ) { $ xobjects = $ resources -> get ( 'XObject' ) -> getElements ( ) ; } else { $ xobjects = $ resources -> get ( 'XObject' ) -> getHeader ( ) -> getElements ( ) ; } $ table = array ( ) ; foreach ( $ xobjects as $ id => $ xobject ) { $ table [ $ id ] = $ xobject ; // Store too on cleaned id value (only numeric) $ id = preg_replace ( '/[^0-9\.\-_]/' , '' , $ id ) ; if ( $ id != '' ) { $ table [ $ id ] = $ xobject ; } } return ( $ this -> xobjects = $ table ) ; } else { return array ( ) ; } }
Support for XObject

@return PDFObject[]
Support for XObject