本文整理匯總了PHP中Font::CreateType1Font方法的典型用法代碼示例。如果您正苦於以下問題:PHP Font::CreateType1Font方法的具體用法?PHP Font::CreateType1Font怎麽用?PHP Font::CreateType1Font使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類Font
的用法示例。
在下文中一共展示了Font::CreateType1Font方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: Rect
$doc->PagePushBack($page);
// Start a new page ------------------------------------
//
// The example illustrates how to embed the external font in a PDF document.
// The example also shows how ElementReader can be used to copy and modify
// Elements between pages.
// Start reading Elements from the last page. We will copy all Elements to
// a new page but will modify the font associated with text.
$reader->Begin($doc->GetPage($doc->GetPageCount()));
$page = $doc->PageCreate(new Rect(0.0, 0.0, 1300.0, 794.0));
$writer->Begin($page);
// begin writing to this page
$builder->Reset();
// Reset the GState to default
// Embed an external font in the document.
$font2 = Font::CreateType1Font($doc->GetSDFDoc(), $input_path . "Misc-Fixed.pfa");
while ($element = $reader->Next()) {
if ($element->GetType() == Element::e_text) {
$element->GetGState()->SetFont($font2, 12);
}
$writer->WriteElement($element);
}
$reader->End();
$writer->End();
// save changes to the current page
$doc->PagePushBack($page);
// Start a new page ------------------------------------
$page = $doc->PageCreate();
$writer->Begin($page);
// begin writing to this page
$builder->Reset();