本文整理汇总了PHP中MYPDF::setMargins方法的典型用法代码示例。如果您正苦于以下问题:PHP MYPDF::setMargins方法的具体用法?PHP MYPDF::setMargins怎么用?PHP MYPDF::setMargins使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类MYPDF
的用法示例。
在下文中一共展示了MYPDF::setMargins方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: MYPDF
$pagewidth = $pagesize[0] = $width;
$pageheight = $pagesize[1] = $height;
$pdf = new MYPDF("portrait", "in", $size, true, 'UTF-8', false);
$pdf->SetFont($annotate_font, '', 8);
// set document information
$pdf->SetCreator(PDF_CREATOR);
$pdf->SetAuthor($userfullname);
if ($is_collection) {
$pdf->SetTitle(i18n_get_collection_name($collectiondata) . ' ' . $date);
} else {
$pdf->SetTitle(i18n_get_translated($resourcedata['field' . $view_title_field]) . ' ' . $date);
}
$pdf->SetSubject($lang['annotations']);
$pdf->setPrintHeader(false);
$pdf->setPrintFooter(false);
$pdf->setMargins(0.5, 0.5, 0.5);
// add a page
for ($n = 0; $n < count($resources); $n++) {
$pdf->AddPage();
$resourcedata = $resources[$n];
$ref = $resources[$n]['ref'];
$access = get_resource_access($resources[$n]['ref']);
// feed get_resource_access the resource array rather than the ref, since access is included.
$use_watermark = check_use_watermark();
$imgpath = get_resource_path($ref, true, "hpr", false, "jpg", -1, 1, $use_watermark);
if (!file_exists($imgpath)) {
$imgpath = get_resource_path($ref, true, "lpr", false, "jpg", -1, 1, $use_watermark);
}
if (!file_exists($imgpath)) {
$imgpath = get_resource_path($ref, true, "scr", false, "jpg", -1, 1, $use_watermark);
}
示例2: Footer
public function Footer() {
if ($this->page != 1) {
// Position at 15 mm from bottom
$this->SetY(-15);
// Set font
$this->SetFont('times', '', 11);
// Page number
$this->Cell(0, 0, $this->getAliasNumPage(), 0, false, 'C', 0, '', 0, false, 'T', 'M');
}
}
}
$pdf = new MYPDF(PDF_PAGE_ORIENTATION, PDF_UNIT, PDF_PAGE_FORMAT, true, 'UTF-8', false, 'test');
$pdf->setStoryTitle($title[0]['title']);
$pdf->finished($finished[0]['date']);
$pdf->setstoryWriters($writers);
$pdf->setHeaderFont(array('times', '', 25));
$pdf->setFooterData(array(0,64,0), array(0,64,128));
$pdf->setMargins(10,30,10,30);
$pdf->AddPage();
$pdf->AddPage();
$text = '';
foreach($words as $word) {
$text .= ' ' . $word['words'];
}
$pdf->Text(9,35,$text,0);
$pdf->SetFont('courier');
$pdf->setCellHeightRatio(3);
// $pdf->MultiCell(0, 0, 0, 0, 'L', false, 1, 10, 30, true, 2, false, true, 0, 'T', true);
$pdf->Output('GN_' . $title[0]['title'] . '.pdf', 'I');
?>