CakePdf\Pdf\Engine\WkHtmlToPdfEngine::output PHP Method

output() public method

Generates Pdf from html
public output ( ) : string
return string raw pdf data
    public function output()
    {
        $content = $this->_exec($this->_getCommand(), $this->_Pdf->html());
        if (strpos(mb_strtolower($content['stderr']), 'error')) {
            throw new Exception("System error <pre>" . $content['stderr'] . "</pre>");
        }
        if (mb_strlen($content['stdout'], $this->_Pdf->encoding()) === 0) {
            throw new Exception("WKHTMLTOPDF didn't return any data");
        }
        if ((int) $content['return'] !== 0 && !empty($content['stderr'])) {
            throw new Exception("Shell error, return code: " . (int) $content['return']);
        }
        return $content['stdout'];
    }