本文整理汇总了PHP中FPDI::writeHTML方法的典型用法代码示例。如果您正苦于以下问题:PHP FPDI::writeHTML方法的具体用法?PHP FPDI::writeHTML怎么用?PHP FPDI::writeHTML使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类FPDI
的用法示例。
在下文中一共展示了FPDI::writeHTML方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: strlen
$data_body[$p] .= strlen($total['rtp_audio_in_mos']) > 0 ? $fields['rtp_audio_in_mos'] : null;
}
$data_body[$p] .= '</td>';
$data_body[$p] .= '<td width="2%"></td>';
$data_body[$p] .= '<td width="15%">' . ucwords(strtolower(str_replace("_", " ", $fields['hangup_cause']))) . '</td>';
$data_body[$p] .= '</tr>';
$z++;
$p++;
if ($p == 60) {
//output data
$data_body_chunk = $data_start . $data_head;
foreach ($data_body as $data_body_row) {
$data_body_chunk .= $data_body_row;
}
$data_body_chunk .= $data_end;
$pdf->writeHTML($data_body_chunk, true, false, false, false, '');
unset($data_body_chunk);
unset($data_body);
$p = 0;
//add new page
$pdf->AddPage('L', array($page_width, $page_height));
}
}
}
//write divider
$data_footer = '<tr><td colspan="12"></td></tr>';
//write totals
$data_footer .= '<tr>';
$data_footer .= '<td><b>' . $text['label-total'] . '</b></td>';
$data_footer .= '<td>' . $z . '</td>';
$data_footer .= '<td colspan="3"></td>';
示例2: WriteHTML
public function WriteHTML($html)
{
if (trim($html) == "") {
return;
}
if ($this instanceof TCPDF) {
return parent::writeHTML($html);
}
$this->sizeStack[] = $this->getFontSize();
$html = str_replace("\n", "", $html);
$html = preg_replace('/<!--\\[if[^\\]]*]>.*?<!\\[endif\\]-->/i', '', $html);
$bad = array(">", "<", "&");
$good = array("::gt::", "::lt::", "::amp::");
libxml_use_internal_errors(true);
try {
$xml = new SimpleXMLElement(str_replace($good, $bad, "<phynx>" . html_entity_decode(str_replace($bad, $good, $html), ENT_NOQUOTES, "UTF-8") . "</phynx>"));
} catch (Exception $e) {
try {
$tidy = new tidy();
$tidy->parseString($html, array("show-body-only" => true, "output-xhtml" => true, "wrap" => 0), 'utf8');
$tidy->cleanRepair();
$xml = new SimpleXMLElement(str_replace($good, $bad, "<phynx>" . html_entity_decode(str_replace($bad, $good, $tidy), ENT_NOQUOTES, "UTF-8") . "</phynx>"));
} catch (Exception $e) {
$errors = "";
foreach (libxml_get_errors() as $error) {
#echo "\t", $error->message;
$errors .= htmlentities(trim($error->message)) . "<br />";
}
$xml = new SimpleXMLElement("<phynx><p style=\"color:#dd0000;\">Der Textbaustein konnte nicht geladen werden:<br />{$errors}</p></phynx>");
}
}
$this->translateXML($xml);
}