本文整理汇总了PHP中DOMPDF::set_options方法的典型用法代码示例。如果您正苦于以下问题:PHP DOMPDF::set_options方法的具体用法?PHP DOMPDF::set_options怎么用?PHP DOMPDF::set_options使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类DOMPDF
的用法示例。
在下文中一共展示了DOMPDF::set_options方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: outputFN
public function outputFN($type)
{
// manda effettivamente al browser la pagina oppure solo i dati (dimensioni, testo, ...))
switch ($type) {
case 'page':
// standard
// standard
default:
$data = $this->htmlheader;
$data .= $this->htmlbody;
$data .= $this->htmlfooter;
print $data;
break;
case 'dimension':
$data = $this->htmlheader;
$data .= $this->htmlbody;
$data .= $this->htmlfooter;
$dim_data = strlen($data);
print $dim_data;
break;
case 'text':
$data = $this->htmlheader;
$data .= $this->htmlbody;
$data .= $this->htmlfooter;
$text_data = strip_tags($data);
print $text_data;
break;
case 'source':
// debugging purpose only
$data = $this->htmlheader;
$data .= $this->htmlbody;
$data .= $this->htmlfooter;
$source_data = htmlentities($data, ENT_COMPAT | ENT_HTML401, ADA_CHARSET);
print $source_data;
break;
case 'error':
// debugging purpose only
$data = $this->error;
print $data;
break;
case 'file':
// useful for caching pages
$data = $this->htmlheader;
$data .= $this->htmlbody;
$data .= $this->htmlfooter;
$fp = fopen($this->full_static_filename, "w");
$result = fwrite($fp, $data);
fclose($fp);
break;
case 'pdf':
$data = $this->htmlheader;
$data .= $this->htmlbody;
$data .= $this->htmlfooter;
require_once ROOT_DIR . '/include/dompdf/dompdf_config.inc.php';
$dompdf_options = array("default_media_type" => 'print', "default_paper_size" => 'a4', "enable_unicode" => DOMPDF_UNICODE_ENABLED, "enable_php" => DOMPDF_ENABLE_PHP, "enable_remote" => true, "enable_css_float" => true, "enable_javascript" => true, "enable_html5_parser" => DOMPDF_ENABLE_HTML5PARSER, "enable_font_subsetting" => DOMPDF_ENABLE_FONTSUBSETTING);
$dompdf = new DOMPDF();
$dompdf->set_options($dompdf_options);
$dompdf->set_paper('a4', $this->orientation);
$dompdf->load_html($data);
$dompdf->render();
$dompdf->stream($this->outputfile . '.pdf', array('Attachment' => 0));
die;
break;
}
}