src/Pdf/CakePdf.php
public function output($html = null)
    {
        $Engine = $this->engine();
        if (!$Engine) {
            throw new Exception(__d('cake_pdf', 'Engine is not loaded'));
        }

        if ($html === null) {
            $html = $this->_render();
        }
        $this->html($html);

        $cacheKey = null;
        $cache = $this->cache();
        if ($cache) {
            $cacheKey = md5(serialize($this));
            $cached = Cache::read($cacheKey, $cache);
            if ($cached) {
                return $cached;
            }
        }

        $output = $Engine->output();

        if ($this->protect()) {
            $output = $this->crypto()->encrypt($output);
        }

        if ($cache) {
            Cache::write($cacheKey, $output, $cache);
        }

        return $output;
    }
public function output($html = null)
    {
        $Engine = $this->engine();
        if (!$Engine) {
            throw new Exception(__d('cake_pdf', 'Engine is not loaded'));
        }

        if ($html === null) {
            $html = $this->_render();
        }
        $this->html($html);

        $cacheKey = null;
        $cache = $this->cache();
        if ($cache) {
            $cacheKey = md5(serialize($this));
            $cached = Cache::read($cacheKey, $cache);
            if ($cached) {
                return $cached;
            }
        }

        $output = $Engine->output();

        if ($this->protect()) {
            $output = $this->crypto()->encrypt($output);
        }

        if ($cache) {
            Cache::write($cacheKey, $output, $cache);
        }

        return $output;
    }
public function output ( $ html = null ) { $ Engine = $ this -> engine ( ) ; if ( ! $ Engine ) { throw new Exception ( __d ( 'cake_pdf' , 'Engine is not loaded' ) ) ; } if ( $ html === null ) { $ html = $ this -> _render ( ) ; } $ this -> html ( $ html ) ; $ cacheKey = null ; $ cache = $ this -> cache ( ) ; if ( $ cache ) { $ cacheKey = md5 ( serialize ( $ this ) ) ; $ cached = Cache :: read ( $ cacheKey , $ cache ) ; if ( $ cached ) { return $ cached ; } } $ output = $ Engine -> output ( ) ; if ( $ this -> protect ( ) ) { $ output = $ this -> crypto ( ) -> encrypt ( $ output ) ; } if ( $ cache ) { Cache :: write ( $ cacheKey , $ output , $ cache ) ; } return $ output ; }
Create pdf content from html. Can be used to write to file or with PdfView to display

@param null|string $html Html content to render. If omitted, the template will be rendered with viewVars and layout that have been set.
@throws \Cake\Core\Exception\Exception
@return string
Create pdf content from html . Can be used to write to file or with PdfView to display