lib/ezpdf/classes/class.pdf.php
function addObject( $id, $options = 'add' )
    {
        // add the specified object to the page
        if ( isset( $this->looseObjects[$id] ) && $this->currentContents != $id )
        {
            // then it is a valid object, and it is not being added to itself
            switch ( $options )
            {
            case 'all':
                // then this object is to be added to this page (done in the next block) and
                // all future new pages.
                $this->addLooseObjects[$id] = 'all';
            case 'add':
                if ( isset( $this->objects[$this->currentContents]['onPage'] ) )
                {
                    // then the destination contents is the primary for the page
                    // (though this object is actually added to that page)
                    $this->o_page( $this->objects[$this->currentContents]['onPage'], 'content', $id );
                }
                break;
            case 'even':
                $this->addLooseObjects[$id] = 'even';
                $pageObjectId = $this->objects[$this->currentContents]['onPage'];
                if ( $this->objects[$pageObjectId]['info']['pageNum'] % 2 == 0 )
                {
                    $this->addObject( $id ); // hacky huh :)
                }
                break;
            case 'odd':
                $this->addLooseObjects[$id] = 'odd';
                $pageObjectId = $this->objects[$this->currentContents]['onPage'];
                if ( $this->objects[$pageObjectId]['info']['pageNum'] % 2 == 1 )
                {
                    $this->addObject( $id ); // hacky huh :)
                }
                break;
            case 'next':
                $this->addLooseObjects[$id] = 'all';
                break;
            case 'nexteven':
                $this->addLooseObjects[$id] = 'even';
                break;
            case 'nextodd':
                $this->addLooseObjects[$id] = 'odd';
                break;
            }
        }
    }
function addObject( $id, $options = 'add' )
    {
        // add the specified object to the page
        if ( isset( $this->looseObjects[$id] ) && $this->currentContents != $id )
        {
            // then it is a valid object, and it is not being added to itself
            switch ( $options )
            {
            case 'all':
                // then this object is to be added to this page (done in the next block) and
                // all future new pages.
                $this->addLooseObjects[$id] = 'all';
            case 'add':
                if ( isset( $this->objects[$this->currentContents]['onPage'] ) )
                {
                    // then the destination contents is the primary for the page
                    // (though this object is actually added to that page)
                    $this->o_page( $this->objects[$this->currentContents]['onPage'], 'content', $id );
                }
                break;
            case 'even':
                $this->addLooseObjects[$id] = 'even';
                $pageObjectId = $this->objects[$this->currentContents]['onPage'];
                if ( $this->objects[$pageObjectId]['info']['pageNum'] % 2 == 0 )
                {
                    $this->addObject( $id ); // hacky huh :)
                }
                break;
            case 'odd':
                $this->addLooseObjects[$id] = 'odd';
                $pageObjectId = $this->objects[$this->currentContents]['onPage'];
                if ( $this->objects[$pageObjectId]['info']['pageNum'] % 2 == 1 )
                {
                    $this->addObject( $id ); // hacky huh :)
                }
                break;
            case 'next':
                $this->addLooseObjects[$id] = 'all';
                break;
            case 'nexteven':
                $this->addLooseObjects[$id] = 'even';
                break;
            case 'nextodd':
                $this->addLooseObjects[$id] = 'odd';
                break;
            }
        }
    }
function addObject ( $ id , $ options = 'add' ) { // add the specified object to the page if ( isset ( $ this -> looseObjects [ $ id ] ) && $ this -> currentContents != $ id ) { // then it is a valid object, and it is not being added to itself switch ( $ options ) { case 'all' : // then this object is to be added to this page (done in the next block) and // all future new pages. $ this -> addLooseObjects [ $ id ] = 'all' ; case 'add' : if ( isset ( $ this -> objects [ $ this -> currentContents ] [ 'onPage' ] ) ) { // then the destination contents is the primary for the page // (though this object is actually added to that page) $ this -> o_page ( $ this -> objects [ $ this -> currentContents ] [ 'onPage' ] , 'content' , $ id ) ; } break ; case 'even' : $ this -> addLooseObjects [ $ id ] = 'even' ; $ pageObjectId = $ this -> objects [ $ this -> currentContents ] [ 'onPage' ] ; if ( $ this -> objects [ $ pageObjectId ] [ 'info' ] [ 'pageNum' ] % 2 == 0 ) { $ this -> addObject ( $ id ) ; // hacky huh :) } break ; case 'odd' : $ this -> addLooseObjects [ $ id ] = 'odd' ; $ pageObjectId = $ this -> objects [ $ this -> currentContents ] [ 'onPage' ] ; if ( $ this -> objects [ $ pageObjectId ] [ 'info' ] [ 'pageNum' ] % 2 == 1 ) { $ this -> addObject ( $ id ) ; // hacky huh :) } break ; case 'next' : $ this -> addLooseObjects [ $ id ] = 'all' ; break ; case 'nexteven' : $ this -> addLooseObjects [ $ id ] = 'even' ; break ; case 'nextodd' : $ this -> addLooseObjects [ $ id ] = 'odd' ; break ; } } }
after an object has been created, it wil only show if it has been added, using this function.
after an object has been created it wil only show if it has been added using this function .