本文整理匯總了PHP中pdf::setFontSubsetting方法的典型用法代碼示例。如果您正苦於以下問題:PHP pdf::setFontSubsetting方法的具體用法?PHP pdf::setFontSubsetting怎麽用?PHP pdf::setFontSubsetting使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類pdf
的用法示例。
在下文中一共展示了pdf::setFontSubsetting方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: create_pdf_object
/**
* Create PDF object using parameters
*
* @return PDF
*/
protected function create_pdf_object()
{
//Default orientation is Landescape
$orientation = 'L';
if ($this->get_instance()->height > $this->get_instance()->width) {
$orientation = 'P';
}
// Remove commas to avoid a bug in TCPDF where a string containing a commas will result in two strings.
$keywords = get_string('keywords', 'simplecertificate') . ',' . format_string($this->get_instance()->coursename, true);
$keywords = str_replace(",", " ", $keywords);
// Replace commas with spaces.
$keywords = str_replace(" ", " ", $keywords);
// Replace two spaces with one.
$pdf = new pdf($orientation, 'mm', array($this->get_instance()->width, $this->get_instance()->height), true, 'UTF-8');
$pdf->SetTitle($this->get_instance()->name);
$pdf->SetSubject($this->get_instance()->name . ' - ' . $this->get_instance()->coursename);
$pdf->SetKeywords($keywords);
$pdf->setPrintHeader(false);
$pdf->setPrintFooter(false);
$pdf->SetAutoPageBreak(false, 0);
$pdf->setFontSubsetting(true);
$pdf->SetMargins(0, 0, 0, true);
return $pdf;
}