本文整理汇总了PHP中HTML2FPDF::Output方法的典型用法代码示例。如果您正苦于以下问题:PHP HTML2FPDF::Output方法的具体用法?PHP HTML2FPDF::Output怎么用?PHP HTML2FPDF::Output使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类HTML2FPDF
的用法示例。
在下文中一共展示了HTML2FPDF::Output方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: fopen
<?php
$handle = fopen("invoice_gen.html", 'w+');
if ($handle) {
if (!fwrite($handle, "<table border=1px>\n\t <tr> <td>dfddfdfdf</td></tr>\t\n\t</table>")) {
die("couldn't write to file.");
}
echo "success writing to file";
}
require 'html2fpdf.php';
$pdf = new HTML2FPDF();
$pdf->AddPage();
$fp = fopen("invoice_gen.html", "r");
$strContent = fread($fp, filesize("invoice_gen.html"));
fclose($fp);
$pdf->WriteHTML($strContent);
$pdf->Output("invoice_gen.pdf");
echo "PDF file is generated successfully!";
示例2:
function event_espresso_generat_pdf($name = "Invoice", $content)
{
require_once 'html2fpdf.php';
//exit($content);
$pdf = new HTML2FPDF('P', 'mm', 'Letter');
$pdf->AddPage();
$pdf->WriteHTML($content);
$pdf->Output($name . '.pdf', 'D');
}
示例3: Create
function Create()
{
$this->content = utf8_decode($this->_ParseHTML($this->content));
$pdf = new HTML2FPDF();
$pdf->ShowNOIMG_GIF();
$pdf->DisplayPreferences('HideWindowUI');
$pdf->AddPage();
$pdf->WriteHTML($this->content);
$pdf->Output(\Cx\Lib\FileSystem\FileSystem::replaceCharacters($this->title));
}
示例4: PDF_html_2_pdf
function PDF_html_2_pdf($data)
{
global $auth;
$pdf = new HTML2FPDF();
$pdf->UseCSS();
$pdf->UseTableHeader();
$pdf->AddPage();
$pdf->WriteHTML(AdjustHTML($data));
$pdf->Output();
}
示例5: Pdf_do
public function Pdf_do($config = array())
{
$source_name = $config['name'];
$task_name = $config['output'];
require 'htmlofpdf/html2fpdf.php';
$pdf = new HTML2FPDF();
$pdf->AddGBFont('GB', 'GB2312');
$pdf->AddPage();
$fp = fopen($source_name, "r");
$strContent = fread($fp, filesize($source_name));
fclose($fp);
$pdf->WriteHTML(iconv("UTF-8", "GB2312", $strContent));
ob_clean();
$pdf->Output($task_name, true);
}
示例6: createPDF
public function createPDF($url)
{
$url = 'http://clients.skiify.com/eximagen/en/boligrafos-plasticos/430-boligrafo-pilot.html';
require_once '/html2pdf/html2fpdf.php';
// Create new HTML2PDF class for an A4 page, measurements in mm
$pdf = new HTML2FPDF('P', 'mm', 'A4');
$buffer = file_get_contents($url);
var_dump($buffer);
// Optional top margin
$pdf->SetTopMargin(1);
$pdf->AddPage();
// Control the x-y position of the html
$pdf->SetXY(0, 0);
$pdf->WriteHTML($buffer);
// The 'D' arg forces the browser to download the file
$pdf->Output('MyFile.pdf', 'D');
}
示例7: header
</tr>
<tr>
<td> </td>
<td> </td>
</tr>
<tr>
<td> </td>
<td><div align="right">
<input type="submit" name="Submit" value="Ver Reporte" class = "boton"/>
</div></td>
</tr>
</table>
</form>
<?php
}
?>
</body>
</html>
<?php
if ($_REQUEST["tipo"] == 1) {
$pdf = new HTML2FPDF('P', 'mm', 'a4');
$htmlbuffer = ob_get_contents();
ob_end_clean();
header("Content-type: application/pdf");
$pdf->ubic_css = "css/reporte.css";
$pdf->DisplayPreferences('HideWindowUI');
$pdf->AddPage();
$pdf->WriteHTML($htmlbuffer);
$pdf->Output("Reporte_Busqueda.pdf", 'I');
}
示例8: DisplayPDF
function DisplayPDF($smarty, $invoicetype, $template)
{
require_once 'pdf-invoices/html2pdf/html2fpdf.php';
$pdf = new HTML2FPDF();
$pdf->DisplayPreferences('HideWindowUI');
$pdf->AddPage();
$pdf->WriteHTML($this->GetHTML($smarty, $invoicetype, $template));
// TODO: find a better name
return $pdf->Output('Invoice_' . date("d/m/Y-H:i") . '.pdf', 'I');
}
示例9: getContent
//.........这里部分代码省略.........
}
global $sourceFolder;
global $moduleFolder;
require_once $sourceFolder . "/" . $moduleFolder . "/" . $moduleType . ".lib.php";
$page = new $moduleType();
if (!$page instanceof module) {
displayerror("The module \"{$moduleType}\" does not implement the inteface module</div>");
return "";
}
$createperms_query = " SELECT * FROM " . MYSQL_DATABASE_PREFIX . "permissionlist where perm_action = 'create' AND page_module = '" . $moduleType . "'";
$createperms_result = mysql_query($createperms_query);
if (mysql_num_rows($createperms_result) < 1) {
displayerror("The action \"create\" does not exist in the module \"{$moduleType}\"</div>");
return "";
}
$availableperms_query = "SELECT * FROM " . MYSQL_DATABASE_PREFIX . "permissionlist where perm_action != 'create' AND page_module = '" . $moduleType . "'";
$availableperms_result = mysql_query($availableperms_query);
$permlist = array();
while ($value = mysql_fetch_assoc($availableperms_result)) {
array_push($permlist, $value['perm_action']);
}
array_push($permlist, "view");
$class_methods = get_class_methods($moduleType);
foreach ($permlist as $perm) {
if (!in_array("action" . ucfirst($perm), $class_methods)) {
displayerror("The action \"{$perm}\" does not exist in the module \"{$moduleType}\"</div>");
return "";
}
}
if ($action == "pdf") {
if (isset($_GET['depth'])) {
$depth = $_GET['depth'];
} else {
$depth = 0;
}
if (!is_numeric($depth)) {
$depth = 0;
}
global $TITLE;
global $sourceFolder;
require_once "{$sourceFolder}/modules/pdf/html2fpdf.php";
$pdf = new HTML2FPDF();
$pdf->setModuleComponentId($moduleComponentId);
$pdf->AddPage();
$pdf->WriteHTML($page->getHtml($userId, $moduleComponentId, "view"));
$cp = array();
$j = 0;
if ($depth == -1) {
$cp = child($pageId, $userId, $depth);
if ($cp[0][0]) {
for ($i = 0; $cp[$i][0] != NULL; $i++) {
require_once $sourceFolder . "/" . $moduleFolder . "/" . $cp[$i][2] . ".lib.php";
$page1 = new $cp[$i][2]();
$modCompId = $cp[$i][5];
$pdf->setModuleComponentId($modCompId);
$pdf->AddPage();
$pdf->WriteHTML($page1->getHtml($userId, $modCompId, "view"));
}
}
} else {
if ($depth > 0) {
$cp = child($pageId, $userId, $depth);
--$depth;
while ($depth > 0) {
$count = count($cp);
for ($j; $j < $count; $j++) {
$cp = array_merge((array) $cp, (array) child($cp[$j][0], $userId, $depth));
}
--$depth;
}
if ($cp[0][0]) {
for ($i = 0; isset($cp[$i]); $i++) {
require_once $sourceFolder . "/" . $moduleFolder . "/" . $cp[$i][2] . ".lib.php";
$page1 = new $cp[$i][2]();
$modCompId = $cp[$i][5];
$pdf->setModuleComponentId($modCompId);
$pdf->AddPage();
$pdf->WriteHTML($page1->getHtml($userId, $modCompId, "view"));
}
}
}
}
$filePath = $sourceFolder . "/uploads/temp/" . $TITLE . ".pdf";
while (file_exists($filePath)) {
$filePath = $sourceFolder . "/uploads/temp/" . $TITLE . "-" . rand() . ".pdf";
}
$pdf->Output($filePath);
header("Pragma: public");
header("Expires: 0");
header("Cache-Control: must-revalidate, post-check=0, pre-check=0");
header("Cache-Control: private", false);
header("Content-Type: application/pdf");
header("Content-Disposition: attachment; filename=\"" . basename($filePath) . "\";");
header("Content-Transfer-Encoding: binary");
header("Content-Length: " . filesize($filePath));
@readfile("{$filePath}");
unlink($filePath);
}
return $page->getHtml($userId, $moduleComponentId, $action);
}
示例10:
else*/
if ($lessonIndex !== false) {
$html .= "bgcolor=\"#" . str_pad(dechex(isset($colors[$bookings[$lessonIndex][0]][0]) ? $colors[$bookings[$lessonIndex][0]][0] : 200), 2, "0", STR_PAD_LEFT) . str_pad(dechex(isset($colors[$bookings[$lessonIndex][0]][1]) ? $colors[$bookings[$lessonIndex][0]][1] : 200), 2, "0", STR_PAD_LEFT) . str_pad(dechex(isset($colors[$bookings[$lessonIndex][0]][2]) ? $colors[$bookings[$lessonIndex][0]][2] : 200), 2, "0", STR_PAD_LEFT) . "\"";
}
$html .= ">";
if ($lessonIndex !== false) {
$html .= "<font color=\"#" . str_pad(dechex(getSingleContrastColor(isset($colors[$bookings[$lessonIndex][0]][0]) ? $colors[$bookings[$lessonIndex][0]][0] : 200)), 2, "0", STR_PAD_LEFT) . str_pad(dechex(getSingleContrastColor(isset($colors[$bookings[$lessonIndex][0]][1]) ? $colors[$bookings[$lessonIndex][0]][1] : 200)), 2, "0", STR_PAD_LEFT) . str_pad(dechex(getSingleContrastColor(isset($colors[$bookings[$lessonIndex][0]][2]) ? $colors[$bookings[$lessonIndex][0]][2] : 200)), 2, "0", STR_PAD_LEFT) . "\">";
}
if ($lessonIndex !== false) {
$html .= $bookings[$lessonIndex][2];
} else {
$html .= " ";
}
if ($lessonIndex !== false) {
$html .= '</font>';
}
$html .= "</td>";
}
$html .= "</tr>";
}
$html .= '</table>';
}
$html .= '</body>
</html>';
$pdf = new HTML2FPDF("L");
$pdf->AddPage();
$pdf->WriteHTML($html);
//echo $html;
$pdf->Output();
//Outputs on browser screen
//$pdf->Output('antrag.pdf'); // save document on server
示例11: iconv
//Assign DetailView Fileds
$xtpl->assign('name', $focus->name);
$xtpl->assign('account_name', $focus->account_name);
$xtpl->assign('account_id', $focus->account_id);
$xtpl->assign('contact_name', $focus->contact_name);
$xtpl->assign('contact_id', $focus->contact_id);
$xtpl->assign('assigned_user_name', $focus->assigned_user_name);
$xtpl->assign('description', nl2br(url2html($focus->description)));
$xtpl->assign('vision', $focus->vision);
$xtpl->assign('period', $app_list_strings['clientorders_period_options'][$focus->period]);
$xtpl->assign('pnum', $focus->number);
$xtpl->assign('category', $app_list_strings['clientorders_category_options'][$focus->category]);
$xtpl->assign('note', $focus->note);
$xtpl->assign('quantity', $focus->quantity);
$xtpl->assign('status', $app_list_strings['clientorder_component_status'][$focus->status]);
$xtpl->assign('samples', $focus->samples);
$xtpl->assign('file', $focus->file);
$xtpl->assign('deadline', $focus->deadline);
$xtpl->assign('date_entered', $focus->date_entered);
$xtpl->assign('date_modified', $focus->date_modified);
$pdf->DisplayPreferences('HideWindowUI');
$pdf->AddPage();
$xtpl->parse("main");
$html = $xtpl->pdf_out('main');
$html_encoded = iconv('utf-8', 'CP1251', $html);
$pdf->UseCSS(true);
$pdf->DisableTags();
$pdf->WriteHTML($html_encoded);
//echo $html_encoded;
$pdf->Output("{$focus->number}.pdf", 'D');
示例12:
<table border=1><tr><td>1</td></tr><tr><td>1</td></tr><tr><td>1</td></tr><tr><td>1</td></tr>
</table>
</BODY>
</HTML>
<?php
$html = ob_get_contents();
ob_end_clean();
// PDFの書式設定
$pdf = new HTML2FPDF("l", "mm", "A4");
$pdf->Open();
$pdf->SetCompression(false);
$pdf->SetDisplayMode("real");
$pdf->UseCSS();
$pdf->UsePRE();
$pdf->setBasePath("http://google.com");
$pdf->AddPage();
//ファイル情報
$pdf->SetAuthor("Kazuhiko HiroseKazuhiko HiroseKazuhiko HiroseKazuhiko HiroseKazuhiko HiroseKazuhiko HiroseKazuhiko HiroseKazuhiko Hirose");
$pdf->Bookmark("BookmarkBookmarkBookmarkBookmarkBookmarkBookmarkBookmarkBookmarkBookmarkBookmarkBookmark");
$pdf->SetTitle("SetTitleSetTitleSetTitleSetTitleSetTitleSetTitleSetTitleSetTitleSetTitleSetTitleSetTitleSetTitle");
$pdf->SetCreator("SetCreatorSetCreatorSetCreatorSetCreatorSetCreatorSetCreatorSetCreatorSetCreatorSetCreatorSetCreator");
// 本文
$pdf->SetMargins(10, 10);
$pdf->DisplayPreferences('HideWindowUI');
//$pdf->SetFont( HideWindowUI,"",8);
$pdf->WriteHTML($html);
// 出力
$pdf->Output('doc.pdf', 'D');
示例13: strtoupper
<tr class="fil">
<td><span>5.2 PRESUPUESTO DEL PROYECTO : <?php
echo strtoupper(utf8_encode($value[39]));
?>
</span> </td>
</tr>
<tr class="fil">
<td><span>5.3 FINANCIAMIENTO : <?php
echo strtoupper(utf8_encode($value[41]));
?>
</strong></span> </td>
</tr>-->
<?php
}
?>
</tbody></table>
</div>
</page>
<?php
$content = ob_get_clean();
$pdf = new HTML2FPDF('P', 'mm', 'A4', 'UTF-8');
$pdf->UseCSS($opt == true);
$pdf->AddPage();
$pdf->WriteHTML($content);
$pdf->ReadCSS($content);
$pdf->Output('eventos.pdf');
?>
示例14: header
if ($_GET[pdf] == 'ok') {
echo $moneda;
} else {
echo $lnkmoneda;
}
?>
</font>
</td></tr></table>
<table border="1" width="100%" cellspacing="0" cellpadding="0" class="tab" align="center" bgcolor="#FFFFFF">
<?php
$Reporte->partidas();
?>
</table>
<script language="javascript">
FullScreen();
</script>
</body>
</html>
<?php
if ($_GET[pdf] == 'ok') {
$htmlbuffer = ob_get_contents();
ob_end_clean();
header("Content-type: application/pdf");
$pdf = new HTML2FPDF('P', 'mm', 'a4x');
$pdf->ubic_css = "../../style.css";
//agreg mio
$pdf->DisplayPreferences('HideWindowUI');
$pdf->AddPage();
$pdf->WriteHTML($htmlbuffer);
$pdf->Output('presup_por_part_mensual.pdf', 'D');
}
示例15: iconv
/**
* convert html to pdf
*
* @param string $doc_src path to source file, include filename
* @param string $doc_dst path to output file, include filename
*/
function html2pdf($doc_src, $doc_dst)
{
require_once LIB_PATH . 'html2fpdf/html2fpdf.php';
$strContent = @file_get_contents($doc_src);
$strContent = iconv('utf-8', 'gbk', $strContent);
$pdf = new HTML2FPDF();
$pdf->AddPage();
$pdf->writeHTML($strContent);
$pdf->Output($doc_dst);
}