本文整理汇总了PHP中Printer::setPrintHeader方法的典型用法代码示例。如果您正苦于以下问题:PHP Printer::setPrintHeader方法的具体用法?PHP Printer::setPrintHeader怎么用?PHP Printer::setPrintHeader使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Printer
的用法示例。
在下文中一共展示了Printer::setPrintHeader方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: GeneratePDF
function GeneratePDF($module, &$pdf, $pdf_orientation)
{
global $adb, $list_max_entries_per_page;
$product_module_list = array('SalesOrder', 'Quotes', 'PurchaseOrder', 'Invoice');
$idlist = trim($_REQUEST['idstring'], ';');
$idlist = explode(';', $idlist);
chmod('storage', 0777);
$_SESSION['no_of_records'] = count($idlist);
if ($_REQUEST['ParticularSave'] == 'yes') {
$document_list = array();
foreach ($idlist as $id) {
/* ----------------------------- */
$date_var = $adb->formatDate(date('Y-m-d H:i:s'), true);
$query = "insert into vtiger_audit_trial values(?,?,?,?,?,?)";
$qparams = array($adb->getUniqueID('vtiger_audit_trial'), $current_user->id, $module, 'Generate PDF', $id, $date_var);
$adb->pquery($query, $qparams, true);
/* ----------------------------- */
$singlepdf = new Printer();
$singlepdf->setPrintHeader(false);
$singlepdf->setPrintFooter(false);
$singlepdf->SetCompression(true);
$pdf->setPageFormat($_REQUEST['pdf_format'], $pdf_orientation);
$default_margin = 10;
if ($_REQUEST['left'] != '') {
$pdf->SetLeftMargin($_REQUEST['left']);
} else {
$pdf->SetLeftMargin($default_margin);
}
if ($_REQUEST['right'] != '') {
$pdf->SetRightMargin($_REQUEST['right']);
} else {
$pdf->SetRightMargin($default_margin);
}
$_SESSION['top'] = $_REQUEST['top'];
/*
if ( $_REQUEST['top'] != '' ) {
$pdf->SetTopMargin($_REQUEST['top']);
}else{
$pdf->SetTopMargin( $default_margin );
}
if ( $_REQUEST['bottom'] != '' ) {
$pdf->SetAutoPageBreak(true, $_REQUEST['bottom']);
}else{
$pdf->SetAutoPageBreak( $default_margin );
}*/
TakeContent($singlepdf, $module, $id);
## przetworzenie danych z nazwy pliku
/*if ($module == 'Calendar') {
require_once "modules/Calendar/Activity.php";
$module = "Activity";
} else {
require_once "modules/$module/$module.php";
}
require_once "modules/OSSPdf/OSSPdf.php";
require_once "modules/OSSPdf/Print.php";
### Zmienne
*/
$focus = new $module();
### pobranie danych danego modułu
if ($module == "Activity") {
$focus->retrieve_entity_info($id, "Calendar");
} else {
$focus->retrieve_entity_info($id, $module);
}
$fields = $focus->column_fields;
$recordModel = Vtiger_Record_Model::getCleanInstance('OSSPdf');
$_REQUEST['file_name'] = $recordModel->replaceModuleFields($_REQUEST['file_name'], $fields, $module, $id);
$_REQUEST['file_name'] = $recordModel->replaceRelatedModuleFields($_REQUEST['file_name'], $module, $id, $fields, $site_URL = 0);
$_REQUEST['file_name'] = str_replace("#dd-mm-yyyy#", date("d-m-Y"), $_REQUEST['file_name']);
$_REQUEST['file_name'] = str_replace("#mm-dd-yyyy#", date("m-d-Y"), $_REQUEST['file_name']);
$_REQUEST['file_name'] = str_replace("#yyyy-mm-dd#", date("Y-m-d"), $_REQUEST['file_name']);
// ## Koniec przetwarzania danych z nazwy pliku
if (empty($_REQUEST['file_name'])) {
$filepath = $_REQUEST['file_name'] . '_' . $id . '_' . date("YmdHis") . '.pdf';
} else {
$filepath = $_REQUEST['file_name'] . '.pdf';
}
$singlepdf->Output($filepath, 'F');
$docid = 0;
if ($data['ifsave'] == 'yes') {
$document_id = CreateDocument($filepath, $data['ifattach'], $id, $module, $docid);
$nr = $document_id + 1;
$document_list[] = $nr . '_' . $filepath;
$storage_path = decideFilePath();
$pelnasciezka = $storage_path . $nr . '_' . $filepath;
} else {
$document_list[] = $filepath;
$storage_path = decideFilePath();
$pelnasciezka = $storage_path . $filepath;
}
chmod('storage', 0777);
if ($_REQUEST['return_name'] != "yes" || $_REQUEST['return_name'] == "") {
rename($filepath, $pelnasciezka);
} else {
$sciezka = "storage/" . $filepath;
rename($filepath, $sciezka);
}
if ($data['ifattach'] == 'yes') {
$sql = "INSERT INTO vtiger_senotesrel (`crmid`,`notesid`) VALUES ('{$id}','{$docid}')";
//.........这里部分代码省略.........