lib/ezpdf/classes/class.pdf.php
function addJpegFromFile( $img, $x, $y, $w = 0, $h = 0 )
    {
        // attempt to add a jpeg image straight from a file, using no GD commands
        // note that this function is unable to operate on a remote file.

        if ( !file_exists( $img ) )
        {
            //echo "FILE NOT EXISTS: $img";
            return;
        }

        $tmp = getimagesize( $img );
        $imageWidth = $tmp[0];
        $imageHeight = $tmp[1];

        if ( isset( $tmp['channels'] ) )
        {
            $channels = $tmp['channels'];
        }
        else
        {
            $channels = 3;
        }

        if ( $w <= 0 && $h <= 0 )
        {
            $w = $imageWidth;
        }
        if ( $w == 0 )
        {
            $w = $h / $imageHeight * $imageWidth;
        }
        if ( $h == 0 )
        {
            $h = $w * $imageHeight / $imageWidth;
        }

        $fp = fopen( $img, 'rb' );

        $data = fread( $fp, filesize( $img ) );

        fclose( $fp );

        $this->addJpegImage_common( $data, $x, $y, $w, $h, $imageWidth, $imageHeight, $channels );
    }
function addJpegFromFile( $img, $x, $y, $w = 0, $h = 0 )
    {
        // attempt to add a jpeg image straight from a file, using no GD commands
        // note that this function is unable to operate on a remote file.

        if ( !file_exists( $img ) )
        {
            //echo "FILE NOT EXISTS: $img";
            return;
        }

        $tmp = getimagesize( $img );
        $imageWidth = $tmp[0];
        $imageHeight = $tmp[1];

        if ( isset( $tmp['channels'] ) )
        {
            $channels = $tmp['channels'];
        }
        else
        {
            $channels = 3;
        }

        if ( $w <= 0 && $h <= 0 )
        {
            $w = $imageWidth;
        }
        if ( $w == 0 )
        {
            $w = $h / $imageHeight * $imageWidth;
        }
        if ( $h == 0 )
        {
            $h = $w * $imageHeight / $imageWidth;
        }

        $fp = fopen( $img, 'rb' );

        $data = fread( $fp, filesize( $img ) );

        fclose( $fp );

        $this->addJpegImage_common( $data, $x, $y, $w, $h, $imageWidth, $imageHeight, $channels );
    }
function addJpegFromFile ( $ img , $ x , $ y , $ w = 0 , $ h = 0 ) { // attempt to add a jpeg image straight from a file, using no GD commands // note that this function is unable to operate on a remote file. if ( ! file_exists ( $ img ) ) { //echo "FILE NOT EXISTS: $img"; return ; } $ tmp = getimagesize ( $ img ) ; $ imageWidth = $ tmp [ 0 ] ; $ imageHeight = $ tmp [ 1 ] ; if ( isset ( $ tmp [ 'channels' ] ) ) { $ channels = $ tmp [ 'channels' ] ; } else { $ channels = 3 ; } if ( $ w <= 0 && $ h <= 0 ) { $ w = $ imageWidth ; } if ( $ w == 0 ) { $ w = $ h / $ imageHeight * $ imageWidth ; } if ( $ h == 0 ) { $ h = $ w * $ imageHeight / $ imageWidth ; } $ fp = fopen ( $ img , 'rb' ) ; $ data = fread ( $ fp , filesize ( $ img ) ) ; fclose ( $ fp ) ; $ this -> addJpegImage_common ( $ data , $ x , $ y , $ w , $ h , $ imageWidth , $ imageHeight , $ channels ) ; }
add a JPEG image into the document, from a file
add a JPEG image into the document from a file