本文整理汇总了PHP中Cezpdf::newPage方法的典型用法代码示例。如果您正苦于以下问题:PHP Cezpdf::newPage方法的具体用法?PHP Cezpdf::newPage怎么用?PHP Cezpdf::newPage使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Cezpdf
的用法示例。
在下文中一共展示了Cezpdf::newPage方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: pdfObjectsDetails
public function pdfObjectsDetails($result)
{
global $dateformat, $baseURL, $instDir, $objObserver, $loggedUser, $objLocation, $objInstrument, $objPresentations;
$result = $this->sortResult($result);
$pdf = new Cezpdf('a4', 'landscape');
$pdf->selectFont($instDir . 'lib/fonts/Helvetica.afm');
$bottom = 40;
$bottomsection = 30;
$top = 550;
$header = 570;
$footer = 10;
$xleft = 20;
$xmid = 431;
$fontSizeSection = 10;
$fontSizeText = 8;
$descriptionLeadingSpace = 20;
$sectionBarSpace = 3;
$deltalineSection = 2;
$deltaline = $fontSizeText + 4;
$pagenr = 0;
$y = 0;
$xbase = $xmid;
$sectionBarHeight = $fontSizeSection + 4;
$SectionBarWidth = 400 + $sectionBarSpace;
$theDate = date('d/m/Y');
$pdf->addTextWrap($xleft, $header, 100, 8, utf8_decode($theDate));
if ($loggedUser && $objObserver->getObserverProperty($loggedUser, 'name') && $objLocation->getLocationPropertyFromId($objObserver->getObserverProperty($loggedUser, 'stdlocation'), 'name') && $objInstrument->getInstrumentPropertyFromId($objObserver->getObserverProperty($loggedUser, 'stdtelescope'), 'name')) {
$pdf->addTextWrap($xleft, $footer, $xmid + $SectionBarWidth, 8, utf8_decode(html_entity_decode(LangPDFMessage19 . $objObserver->getObserverProperty($loggedUser, 'firstname') . ' ' . $objObserver->getObserverProperty($loggedUser, 'name') . ' ' . LangPDFMessage20 . $objInstrument->getInstrumentPropertyFromId($objObserver->getObserverProperty($loggedUser, 'stdtelescope'), 'name') . ' ' . LangPDFMessage21 . $objLocation->getLocationPropertyFromId($objObserver->getObserverProperty($loggedUser, 'stdlocation'), 'name'))), 'center');
}
$pdf->addTextWrap($xleft, $header, $xmid + $SectionBarWidth, 10, utf8_decode(html_entity_decode($_GET['pdfTitle'])), 'center');
$pdf->addTextWrap($xmid + $SectionBarWidth - $sectionBarSpace - 100, $header, 100, 8, utf8_decode(LangPDFMessage22 . '1'), 'right');
while (list($key, $valueA) = each($result)) {
$con = $valueA['objectconstellation'];
if ($y < $bottom) {
$y = $top;
if ($xbase == $xmid) {
if ($pagenr++) {
$pdf->newPage();
$pdf->addTextWrap($xleft, $header, 100, 8, utf8_decode($theDate));
if ($loggedUser && $objObserver->getObserverProperty($loggedUser, 'name') && $objLocation->getLocationPropertyFromId($objObserver->getObserverProperty($loggedUser, 'stdlocation'), 'name') && $objInstrument->getInstrumentPropertyFromId($objObserver->getObserverProperty($loggedUser, 'stdtelescope'), 'name')) {
$pdf->addTextWrap($xleft, $footer, $xmid + $SectionBarWidth, 8, utf8_decode(html_entity_decode(LangPDFMessage19 . $objObserver->getObserverProperty($loggedUser, 'name') . ' ' . $objObserver->getObserverProperty($loggedUser, 'firstname') . ' ' . LangPDFMessage20 . $objInstrument->getInstrumentPropertyFromId($objObserver->getObserverProperty($loggedUser, 'stdtelescope'), 'name') . ' ' . LangPDFMessage21 . $objLocation->getLocationPropertyFromId($objObserver->getObserverProperty($loggedUser, 'stdlocation'), 'name'))), 'center');
}
$pdf->addTextWrap($xleft, $header, $xmid + $SectionBarWidth, 10, utf8_decode(html_entity_decode($_GET['pdfTitle'])), 'center');
$pdf->addTextWrap($xmid + $SectionBarWidth - $sectionBarSpace - 100, $header, 100, 8, utf8_decode(LangPDFMessage22 . $pagenr), 'right');
}
$xbase = $xleft;
} else {
$xbase = $xmid;
}
}
$pdf->addTextWrap($xbase, $y, 30, $fontSizeText, utf8_decode($valueA['objectseen']));
// seen
$pdf->addTextWrap($xbase + 30, $y, 40, $fontSizeText, utf8_decode($valueA['objectlastseen']));
// last seen
$pdf->addTextWrap($xbase + 70, $y, 85, $fontSizeText, utf8_decode('<b>' . '<c:alink:' . $baseURL . 'index.php?indexAction=detail_object&object=' . urlencode($valueA['objectname']) . '>' . $valueA['showname']));
// object
$pdf->addTextWrap($xbase + 150, $y, 30, $fontSizeText, utf8_decode('</c:alink></b>' . $valueA['objecttype']));
// type
$pdf->addTextWrap($xbase + 180, $y, 20, $fontSizeText, utf8_decode($valueA['objectconstellation']));
// constellation
$pdf->addTextWrap($xbase + 200, $y, 17, $fontSizeText, utf8_decode($objPresentations->presentationInt1($valueA['objectmagnitude'], 99.90000000000001, '')), 'left');
// mag
$pdf->addTextWrap($xbase + 217, $y, 18, $fontSizeText, utf8_decode($objPresentations->presentationInt1($valueA['objectsurfacebrightness'], 99.90000000000001, '')), 'left');
// sb
$pdf->addTextWrap($xbase + 235, $y, 60, $fontSizeText, utf8_decode($objPresentations->raToStringHM($valueA['objectra']) . ' ' . $objPresentations->decToString($valueA['objectdecl'], 0)));
// ra - decl
$pdf->addTextWrap($xbase + 295, $y, 55, $fontSizeText, utf8_decode($valueA['objectsize'] . '/' . $objPresentations->presentationInt($valueA['objectpa'], 999, "-")));
// size
$pdf->addTextWrap($xbase + 351, $y, 17, $fontSizeText, utf8_decode($objPresentations->presentationInt1($valueA['objectcontrast'], '', '')), 'left');
// contrast
$pdf->addTextWrap($xbase + 368, $y, 17, $fontSizeText, utf8_decode((int) $valueA['objectoptimalmagnification']), 'left');
// magnification
$pdf->addTextWrap($xbase + 380, $y, 20, $fontSizeText, utf8_decode('<b>' . $valueA[$loggedUser ? $objObserver->getObserverProperty($loggedUser, 'standardAtlasCode', 'urano') : 'urano'] . '</b>'), 'right');
// atlas page
$y -= $deltaline;
if (array_key_exists('objectlistdescription', $valueA) && $valueA['objectlistdescription']) {
$theText = $objPresentations->br2nl($valueA['objectlistdescription']);
$theText = $pdf->addTextWrap($xbase + $descriptionLeadingSpace, $y, $xmid - $xleft - $descriptionLeadingSpace - 10, $fontSizeText, '<i>' . utf8_decode($theText));
$y -= $deltaline;
while ($theText) {
if ($y < $bottomsection) {
$y = $top;
if ($xbase == $xmid) {
if ($pagenr++) {
$pdf->newPage();
$pdf->addTextWrap($xleft, $header, 100, 8, utf8_decode($theDate));
if ($objObserver->getObserverProperty($loggedUser, 'name') && $objLocation->getLocationPropertyFromId($objObserver->getObserverProperty($loggedUser, 'stdlocation'), 'name') && $objInstrument->getInstrumentPropertyFromId($objObserver->getObserverProperty($loggedUser, 'stdtelescope'), 'name')) {
$pdf->addTextWrap($xleft, $footer, $xmid + $SectionBarWidth, 8, utf8_decode(html_entity_decode(LangPDFMessage19 . $objObserver->getObserverProperty($loggedUser, 'name') . ' ' . $objObserver->getObserverProperty($loggedUser, 'firstname') . LangPDFMessage20 . $objInstrument->getInstrumentPropertyFromId($objObserver->getObserverProperty($loggedUser, 'stdtelescope'), 'name') . ' ' . LangPDFMessage21 . $objLocation->getLocationPropertyFromId($objObserver->getObserverProperty($loggedUser, 'stdlocation'), 'name'))), 'center');
}
$pdf->addTextWrap($xleft, $header, $xmid + $SectionBarWidth, 10, utf8_decode(html_entity_decode($_GET['pdfTitle'])), 'center');
$pdf->addTextWrap($xmid + $SectionBarWidth - $sectionBarSpace - 100, $header, 100, 8, utf8_decode(LangPDFMessage22 . $pagenr), 'right');
}
$xbase = $xleft;
if ($sort) {
$y -= $deltalineSection;
$pdf->rectangle($xbase - $sectionBarSpace, $y - $sectionBarSpace, $SectionBarWidth, $sectionBarHeight);
$pdf->addText($xbase, $y, $fontSizeSection, utf8_decode($GLOBALS[${$sort}]));
$y -= $deltaline + $deltalineSection;
}
} else {
//.........这里部分代码省略.........