本文整理汇总了PHP中pdf::SetHeaderData方法的典型用法代码示例。如果您正苦于以下问题:PHP pdf::SetHeaderData方法的具体用法?PHP pdf::SetHeaderData怎么用?PHP pdf::SetHeaderData使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类pdf
的用法示例。
在下文中一共展示了pdf::SetHeaderData方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: pdf
function report_download_pdf($html)
{
$doc = new pdf();
//$doc->Header();
$doc->SetHeaderData(PDF_HEADER_LOGO, PDF_HEADER_LOGO_WIDTH, PDF_HEADER_TITLE, 'Teleparadigm', array(), array());
$doc->setFooterData(array(0, 64, 0), array(0, 64, 128));
$doc->setPrintHeader(false);
$doc->setPrintFooter(true);
// set margins
$doc->SetMargins(PDF_MARGIN_LEFT, 5, PDF_MARGIN_RIGHT);
$doc->SetHeaderMargin(PDF_MARGIN_HEADER);
$doc->SetFooterMargin(PDF_MARGIN_FOOTER);
$doc->AddPage();
$doc->writeHTML($html, true, false, true, false, '');
$doc->Output();
die;
}
示例2: generate_statistics
//.........这里部分代码省略.........
$summary = $q2show;
}
//print_r($_POST);
//if $summary isn't an array we create one
if (isset($summary) && !is_array($summary)) {
$summary = explode("+", $summary);
}
}
/**
* pdf Config
*/
if ($outputType == 'pdf') {
//require_once('classes/tcpdf/mypdf.php');
Yii::import('application.libraries.admin.pdf', true);
Yii::import('application.helpers.pdfHelper');
$aPdfLanguageSettings = pdfHelper::getPdfLanguageSettings($language);
// create new PDF document
$this->pdf = new pdf();
$surveyInfo = getSurveyInfo($surveyid, $language);
// set document information
$this->pdf->SetCreator(PDF_CREATOR);
$this->pdf->SetAuthor('LimeSurvey');
$this->pdf->SetTitle(sprintf(gT("Statistics survey %s"), $surveyid));
$this->pdf->SetSubject($surveyInfo['surveyls_title']);
$this->pdf->SetKeywords('LimeSurvey,' . gT("Statistics") . ', ' . sprintf(gT("Survey %s"), $surveyid));
$this->pdf->SetDisplayMode('fullpage', 'two');
$this->pdf->setLanguageArray($aPdfLanguageSettings['lg']);
// set header and footer fonts
$this->pdf->setHeaderFont(array($aPdfLanguageSettings['pdffont'], '', PDF_FONT_SIZE_MAIN));
$this->pdf->setFooterFont(array($aPdfLanguageSettings['pdffont'], '', PDF_FONT_SIZE_DATA));
// set default header data
// Since png crashes some servers (and we can not try/catch that) we use .gif (or .jpg) instead
$headerlogo = 'statistics.gif';
$this->pdf->SetHeaderData($headerlogo, 10, gT("Quick statistics", 'unescaped'), gT("Survey") . " " . $surveyid . " '" . flattenText($surveyInfo['surveyls_title'], false, true, 'UTF-8') . "'");
$this->pdf->SetFont($aPdfLanguageSettings['pdffont'], '', $aPdfLanguageSettings['pdffontsize']);
// set default monospaced font
$this->pdf->SetDefaultMonospacedFont(PDF_FONT_MONOSPACED);
}
if ($outputType == 'xls') {
/**
* Initiate the Spreadsheet_Excel_Writer
*/
require_once APPPATH . '/third_party/pear/Spreadsheet/Excel/Xlswriter.php';
if ($pdfOutput == 'F') {
$sFileName = $sTempDir . '/statistic-survey' . $surveyid . '.xls';
$this->workbook = new Xlswriter($sFileName);
} else {
$this->workbook = new Xlswriter();
}
$this->workbook->setVersion(8);
// Inform the module that our data will arrive as UTF-8.
// Set the temporary directory to avoid PHP error messages due to open_basedir restrictions and calls to tempnam("", ...)
$this->workbook->setTempDir($sTempDir);
// Inform the module that our data will arrive as UTF-8.
// Set the temporary directory to avoid PHP error messages due to open_basedir restrictions and calls to tempnam("", ...)
if (!empty($sTempDir)) {
$this->workbook->setTempDir($sTempDir);
}
if ($pdfOutput != 'F') {
$this->workbook->send('statistic-survey' . $surveyid . '.xls');
}
// Creating the first worksheet
$this->sheet = $this->workbook->addWorksheet(utf8_decode('results-survey' . $surveyid));
$this->xlsPercents =& $this->workbook->addFormat();
$this->xlsPercents->setNumFormat('0.00%');
$this->formatBold =& $this->workbook->addFormat(array('Bold' => 1));