本文整理汇总了PHP中HTML2FPDF::PutHREF方法的典型用法代码示例。如果您正苦于以下问题:PHP HTML2FPDF::PutHREF方法的具体用法?PHP HTML2FPDF::PutHREF怎么用?PHP HTML2FPDF::PutHREF使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类HTML2FPDF
的用法示例。
在下文中一共展示了HTML2FPDF::PutHREF方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: HandlePDF
function HandlePDF($pagename)
{
global $WikiTitle;
// modify WikiTitle
$WikiTitle = str_replace(' ', '_', $WikiTitle);
$WikiTitle = html_entity_decode($WikiTitle);
// read wiki page !
//$page = ReadPage($pagename);
$page = RetrieveAuthPage($pagename, 'read', true, READPAGE_CURRENT);
//$date['modif'] = filemtime($_SERVER['DOCUMENT_ROOT'].'/wiki.d/'.$pagename);
// define variable
$xyz['author'] = 'by ' . $page['author'];
// pdf author
$xyz['name']['page'] = str_replace('.', '_', $pagename);
// page name
$xyz['name']['pdf'] = $WikiTitle . '_' . $xyz['name']['page'] . '.pdf';
// pdf name
$xyz['text'] = mv_breakpage($page['text']);
// to transform breakpage markup
$xyz['title'] = $WikiTitle . ' : page ' . $xyz['name']['page'];
// pdf title
$xyz['path'] = $_SERVER["DOCUMENT_ROOT"];
// return root path of your site web
$xyz['url'] = 'http://' . HOST . URI;
// pdf URL
// transform text to html !
$html = change_code(MarkupToHTML($pagename, $xyz['text']));
/*** for test ! ***
echo $xyz['text'];
echo "\n HTML : ".$html;
/** */
//out pass memory server
ini_set('memory_limit', '24M');
ini_set('max_execution_time', 0);
// declare a new object pdf
$pdf = new HTML2FPDF();
// Disactive elements HTML ... cause bad support !
$pdf->DisableTags('<span>');
$pdf->DisableTags('<dl>');
$pdf->DisableTags('<dt>');
$pdf->DisableTags('<dd>');
// generals informations
$pdf->SetCompression(1);
$pdf->SetAuthor($xyz['author']);
$pdf->SetTitle($xyz['title']);
// method implemented by me to return in footer pdf generated.
$pdf->PutHREF($xyz['url']);
// method implemented by html2pdf author !
$pdf->setBasePath($xyz['path']);
// to implement path of your site ; need it for include correctly the image on pdf !
$pdf->UseCSS(false);
// to recognize CSS ... run correctly ?
$pdf->UsePRE(false);
// to recognize element PRE in your code HTML ... but, really bad support !
// build the page PDF
$pdf->AddPage();
$pdf->WriteHTML($html);
$pdf->Output($xyz['name']['pdf'], I);
/**/
// retabli valeur serveur
ini_set('memory_limit', MEM);
ini_set('max_execution_time', MAX_TIME);
}