本文整理汇总了PHP中HTML2FPDF::UseCss方法的典型用法代码示例。如果您正苦于以下问题:PHP HTML2FPDF::UseCss方法的具体用法?PHP HTML2FPDF::UseCss怎么用?PHP HTML2FPDF::UseCss使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类HTML2FPDF
的用法示例。
在下文中一共展示了HTML2FPDF::UseCss方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: OutputReport
public function OutputReport($szOutputBuffer, &$szErrorStr)
{
global $gl_root_path;
// Helper variable, init with buffer
$szFinalOutput = $szOutputBuffer;
$res = SUCCESS;
// Simple HTML Output!
if ($this->_outputFormat == REPORT_OUTPUT_HTML) {
// do nothing
} else {
if ($this->_outputFormat == REPORT_OUTPUT_PDF) {
// Convert into PDF!
include_once $gl_root_path . 'classes/html2fpdf/html2fpdf.php';
// $pdf=new HTML2FPDF('landscape');
$pdf = new HTML2FPDF();
$pdf->UseCss(true);
$pdf->AddPage();
// $pdf->SetFontSize(12);
$pdf->WriteHTML($szOutputBuffer);
$szFinalOutput = $pdf->Output('', 'S');
// Output to STANDARD Input!
}
}
// Simple HTML Output!
if ($this->_outputTarget == REPORT_TARGET_STDOUT) {
// Check if we need another header
if ($this->_outputFormat == REPORT_OUTPUT_PDF) {
Header('Content-Type: application/pdf');
}
// Kindly output to browser
echo $szFinalOutput;
$res = SUCCESS;
} else {
if ($this->_outputTarget == REPORT_TARGET_FILE) {
// Get Filename first
if (isset($this->_arrOutputTargetDetails['filename'])) {
// Get Filename property
$szFilename = $this->_arrOutputTargetDetails['filename'];
// Create file and Write Report into it!
$handle = @fopen($szFilename, "w");
if ($handle === false) {
$szErrorStr = "Could not create '" . $szFilename . "'!";
$res = ERROR;
} else {
fwrite($handle, $szFinalOutput);
fflush($handle);
fclose($handle);
// For result
$szErrorStr = "Results were saved into '" . $szFilename . "'";
$res = SUCCESS;
}
} else {
$szErrorStr = "The parameter 'filename' was missing.";
$res = ERROR;
}
}
}
// return result
return $res;
}