当前位置: 首页>>代码示例>>PHP>>正文


PHP Printer::setPrintFooter方法代码示例

本文整理汇总了PHP中Printer::setPrintFooter方法的典型用法代码示例。如果您正苦于以下问题:PHP Printer::setPrintFooter方法的具体用法?PHP Printer::setPrintFooter怎么用?PHP Printer::setPrintFooter使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Printer的用法示例。


在下文中一共展示了Printer::setPrintFooter方法的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}')";
//.........这里部分代码省略.........
开发者ID:rcrrich,项目名称:UpdatePackages,代码行数:101,代码来源:PDFExport.php


注:本文中的Printer::setPrintFooter方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。