本文整理汇总了PHP中DOMPDF::get_options方法的典型用法代码示例。如果您正苦于以下问题:PHP DOMPDF::get_options方法的具体用法?PHP DOMPDF::get_options怎么用?PHP DOMPDF::get_options使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类DOMPDF
的用法示例。
在下文中一共展示了DOMPDF::get_options方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: if
/**
* Class constructor
*
* @param mixed $paper The size of paper to use either a string (see {@link CPDF_Adapter::$PAPER_SIZES}) or
* an array(xmin,ymin,xmax,ymax)
* @param string $orientation The orientation of the document (either 'landscape' or 'portrait')
* @param DOMPDF $dompdf
*/
function __construct($paper = "letter", $orientation = "portrait", DOMPDF $dompdf) {
if ( is_array($paper) ) {
$size = $paper;
}
else if ( isset(self::$PAPER_SIZES[mb_strtolower($paper)]) ) {
$size = self::$PAPER_SIZES[mb_strtolower($paper)];
}
else {
$size = self::$PAPER_SIZES["letter"];
}
if ( mb_strtolower($orientation) === "landscape" ) {
list($size[2], $size[3]) = array($size[3], $size[2]);
}
$this->_width = $size[2] - $size[0];
$this->_height= $size[3] - $size[1];
$this->_dompdf = $dompdf;
$this->_pdf = new PDFLib();
if ( defined("DOMPDF_PDFLIB_LICENSE") )
$this->_pdf->set_parameter( "license", DOMPDF_PDFLIB_LICENSE);
$this->_pdf->set_parameter("textformat", "utf8");
$this->_pdf->set_parameter("fontwarning", "false");
$this->_pdf->set_info("Creator", "DOMPDF");
// Silence pedantic warnings about missing TZ settings
$tz = @date_default_timezone_get();
date_default_timezone_set("UTC");
$this->_pdf->set_info("Date", date("Y-m-d"));
date_default_timezone_set($tz);
if ( self::$IN_MEMORY )
$this->_pdf->begin_document("","");
else {
$tmp_dir = $this->_dompdf->get_options("temp_dir");
$tmp_name = tempnam($tmp_dir, "libdompdf_pdf_");
@unlink($tmp_name);
$this->_file = "$tmp_name.pdf";
$this->_pdf->begin_document($this->_file,"");
}
$this->_pdf->begin_page_ext($this->_width, $this->_height, "");
$this->_page_number = $this->_page_count = 1;
$this->_page_text = array();
$this->_imgs = array();
$this->_fonts = array();
$this->_objs = array();
// Set up font paths
$families = Font_Metrics::get_font_families();
foreach ($families as $files) {
foreach ($files as $file) {
$face = basename($file);
$afm = null;
// Prefer ttfs to afms
if ( file_exists("$file.ttf") ) {
$outline = "$file.ttf";
} else if ( file_exists("$file.TTF") ) {
$outline = "$file.TTF";
} else if ( file_exists("$file.pfb") ) {
$outline = "$file.pfb";
if ( file_exists("$file.afm") ) {
$afm = "$file.afm";
}
} else if ( file_exists("$file.PFB") ) {
$outline = "$file.PFB";
if ( file_exists("$file.AFM") ) {
$afm = "$file.AFM";
}
} else {
continue;
}
$this->_pdf->set_parameter("FontOutline", "\{$face\}=\{$outline\}");
if ( !is_null($afm) ) {
$this->_pdf->set_parameter("FontAFM", "\{$face\}=\{$afm\}");
}
}
}
//.........这里部分代码省略.........