本文整理汇总了PHP中DOMPDF::set_option方法的典型用法代码示例。如果您正苦于以下问题:PHP DOMPDF::set_option方法的具体用法?PHP DOMPDF::set_option怎么用?PHP DOMPDF::set_option使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类DOMPDF
的用法示例。
在下文中一共展示了DOMPDF::set_option方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: initContent
public function initContent()
{
parent::initContent();
$id = $_GET['id'];
$id_lang = $this->context->language->id;
$product = new Product((int) $id);
$link = new Link();
$url = $link->getProductLink($product);
$features = Db::getInstance()->ExecuteS('
SELECT fl.name feature_name, fvl.value feature_value
FROM ' . _DB_PREFIX_ . 'feature_product fp
LEFT JOIN ' . _DB_PREFIX_ . 'feature_lang fl ON (fl.id_feature = fp.id_feature AND fl.id_lang=' . $id_lang . ' )
LEFT JOIN ' . _DB_PREFIX_ . 'feature_value_lang fvl ON (fvl.id_feature_value = fp.id_feature_value AND fvl.id_lang=' . $id_lang . ')
WHERE fp.id_product=' . $id);
// print_r($features);
$images = Image::getImages((int) $id_lang, (int) $product->id);
//Limitamos el numero de fotos a cuatro solamente
while (count($images) > 3) {
$var = array_pop($images);
}
$this->context->smarty->assign(array('product' => $product, 'lang' => $id_lang, 'image' => $images, 'dir' => Tools::getHttpHost(true) . __PS_BASE_URI__ . 'modules/pdfproduct', 'email' => Configuration::get('PS_SHOP_EMAIL'), 'url' => $url, 'address' => Configuration::get('ADDRESS_SHOP'), 'background' => Configuration::get('BACKGROUND')));
$html = $this->context->smarty->fetch(_PS_MODULE_DIR_ . 'pdfproduct/views/templates/front/custom_template_content.tpl');
$dompdf = new DOMPDF();
$dompdf->set_option('enable_remote', TRUE);
$dompdf->load_html($html);
$dompdf->set_paper('a4', 'portrait');
$dompdf->render();
$dompdf->stream('producto');
//$this->setTemplate('custom_template_content.tpl');
//file_put_contents($filename, $dompdf->output());
//$pdf = new PDF($product, 'CustomPdf', Context::getContext()->smarty);
//$img_file = Tools::getHttpHost(true).__PS_BASE_URI__. '/modules/pdfproduct/views/images/background.jpg';
//$pdf->pdf_renderer->Image($img_file, 0, 0, 210, 297, '', '', '', false, 300, '', false, false, 0);
//$pdf->render();
}
示例2: split
if (isset($opts["d"])) {
$_dompdf_show_warnings = true;
$_dompdf_debug = true;
}
if (isset($opts['t'])) {
$arr = split(',', $opts['t']);
$types = array();
foreach ($arr as $type) {
$types[trim($type)] = 1;
}
$_DOMPDF_DEBUG_TYPES = $types;
}
$save_file = true;
break;
default:
$dompdf->set_option('enable_php', false);
if (isset($_GET["input_file"])) {
$file = rawurldecode($_GET["input_file"]);
} else {
throw new DOMPDF_Exception("An input file is required (i.e. input_file _GET variable).");
}
if (isset($_GET["paper"])) {
$paper = rawurldecode($_GET["paper"]);
} else {
$paper = DOMPDF_DEFAULT_PAPER_SIZE;
}
if (isset($_GET["orientation"])) {
$orientation = rawurldecode($_GET["orientation"]);
} else {
$orientation = "portrait";
}