本文整理匯總了PHP中HTML2FPDF::Open方法的典型用法代碼示例。如果您正苦於以下問題:PHP HTML2FPDF::Open方法的具體用法?PHP HTML2FPDF::Open怎麽用?PHP HTML2FPDF::Open使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類HTML2FPDF
的用法示例。
在下文中一共展示了HTML2FPDF::Open方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: define
static function html2pdf($html, $encode = "SJIS")
{
//echo 1;exit;
//$html=self::pdf_change_encode($html,$encode);
define('FPDF_FONTPATH', ROOT . 'lib/html2fpdf/font/');
include ROOT . 'lib/html2fpdf/jphtml2fpdf.php';
$pdf = new HTML2FPDF("l", "mm", "A4");
$pdf->Open();
$pdf->SetCompression(false);
$pdf->SetDisplayMode("real");
$pdf->UseCSS();
$pdf->UsePRE();
$pdf->AddSJISFont();
$pdf->setBasePath("");
$pdf->AddPage();
//ファイル情報
$pdf->SetAuthor("HPX");
$pdf->Bookmark("HPX");
$pdf->SetTitle("HPX");
$pdf->SetCreator("HPX");
// 本文
$pdf->SetMargins(10, 10);
$pdf->DisplayPreferences('HideWindowUI');
//$pdf->SetFont( HideWindowUI,"",8);
$pdf->WriteHTML($html);
// 出力
$pdf->Output('doc.pdf', 'D');
exit;
}
示例2:
<HEAD><TITLE>test</TITLE></HEAD>
<BODY>
<a href=>est</a>
<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);