Exemple #1
0
 /**
  * Convert HTML string to pdf and return it as string
  * @param string $html
  * @param array $options
  * @return string
  */
 function wk_conv_str_to_pdf_str($html, $options)
 {
     $source = sys_get_temp_dir() . DIRECTORY_SEPARATOR . uniqid('ifr_wkhtmltox') . '.html';
     file_put_contents($source, $html);
     $ret = wk_conv_file_to_pdf_str($source, $options);
     if (!App_Application::isDevEnv()) {
         debug_enforce(unlink($source), "Cannot delete temporary file '{$source}'");
     }
     return $ret;
 }