コード例 #1
0
 /**
  * Convert HTML content to PDF
  * 
  * @param   array   $options  The options table
  * @return  mixed             The absolute PDF file (with path) or false when convert failed
  * @access  private
  * @see     ApiPrint::printCmd()
  * @since   1.0.0
  */
 private function printContent($options = array())
 {
     $content = $this->getContent();
     $md5 = $this->getMd5();
     if (empty($content) === true || empty($md5) === true) {
         throw new Exception('Content and md5 can\'t be empty');
     }
     $html_filename = ApiPrint::getHtmlTmpFolder() . '/' . $md5 . '.html';
     if (file_put_contents($html_filename, $content) === false) {
         throw new Exception('unable to create HTML tmp file');
     }
     $pdf_filename = ApiPrint::getPdfTmpFilename($md5, $options);
     return $this->printCmd($html_filename, $pdf_filename, $options);
 }