本文整理汇总了PHP中Cezpdf::rectangle方法的典型用法代码示例。如果您正苦于以下问题:PHP Cezpdf::rectangle方法的具体用法?PHP Cezpdf::rectangle怎么用?PHP Cezpdf::rectangle使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Cezpdf
的用法示例。
在下文中一共展示了Cezpdf::rectangle方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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 {
//.........这里部分代码省略.........
示例2: array
$vilains = array("à", "á", "â", "ã", "ä", "å", "æ", "ç", "è", "é", "ê", "ë", "ì", "í", "î", "ï", "ð", "ñ", "ò", "ó", "ô", "õ", "ö", "÷", "ø", "ù", "ú", "û", "ü", "ý", "þ", "ÿ", "ß", "'", " ", "à", "á", "ã", "ä", "&Arond;", "è", "æ", "ê", "ë", "ì", "í", "Í", "î", "ï", "ò", "ó", "ô", "õ", "ö", "ø", "ù", "ú", "û", "ü", "ñ", "ç", "ý", "<", ">", "&");
$cools = array('à', 'á', 'â', 'ã', 'ä', 'å', 'æ', 'ç', 'è', 'é', 'ê', 'ë', 'ì', 'í', 'î', 'ï', 'ð', 'ñ', 'ò', 'ó', 'ô', 'õ', 'ö', '÷', 'ø', 'ù', 'ú', 'û', 'ü', 'ý', 'þ', 'ÿ', 'ß', '\'', ' ', 'à', 'á', 'ã', 'ä', 'å', 'è', 'æ', 'ê', 'ë', 'ì', 'í', 'î', 'Î', 'ï', 'ò', 'ó', 'ô', 'õ', 'ö', 'ø', 'ù', 'ú', 'û', 'ü', 'ñ', 'ç', 'ý', '<', '>', '&');
$currencies = new currencies();
$pdf->selectFont(BATCH_PDF_DIR . 'Helvetica.afm');
$pdf->setFontFamily(BATCH_PDF_DIR . 'Helvetica.afm');
// company name and details pulled from the my store address and phone number
// in admin configuration mystore
$y = $pdf->ezText(STORE_NAME_ADDRESS, COMPANY_HEADER_FONT_SIZE);
$y -= 10;
// logo image set to right of the above .. change first number to move sideways
$pdf->addJpegFromFile('../images/' . 'store_logo.jpg', 365, 730, 85, 80);
// extra info boxs to be used by staff
$pdf->setStrokeColor(0, 0, 0);
$pdf->setLineStyle(1);
$pdf->roundedRectangle(470, 730, 85, 85, 10, $f = 0);
$pdf->rectangle(535, 748, 10, 10);
$pdf->rectangle(535, 769, 10, 10);
$pdf->rectangle(535, 790, 10, 10);
$pdf->addText(480, 790, GENERAL_FONT_SIZE, TEXT_BANK);
$pdf->addText(480, 769, GENERAL_FONT_SIZE, TEXT_POST);
$pdf->addText(480, 748, GENERAL_FONT_SIZE, TEXT_SALES);
// line between header order number and order date
$pdf->setLineStyle(1);
$pdf->line(LEFT_MARGIN, $y, LINE_LENGTH, $y);
$pdf->ezSetY($y);
$dup_y = $y;
// order number
$y = $pdf->ezText("<b>" . TEXT_ORDER_NUMBER . " </b>" . $orders['orders_prefix'] . $orders['orders_id'] . "\n\n", SUB_HEADING_FONT_SIZE);
// order date
if ($_POST['show_order_date']) {
$pdf->ezSetY($dup_y);
示例3: array
/**
* Creates a PDF document and sends this pricelist to the client
*
* Unfortunately, ezpdf does not return anything after printing the
* document, so there's no way to tell whether it has succeeded.
* Thus, you should not rely on the return value, except when it is
* false -- in that case, loading of some data failed.
* @return boolean False on failure, true on supposed success
*/
function send_as_pdf()
{
global $objInit, $_ARRAYLANG;
if (!$this->load()) {
return \Message::error($_ARRAYLANG['TXT_SHOP_PRICELIST_ERROR_LOADING']);
}
$objPdf = new \Cezpdf('A4');
$objPdf->setEncryption('', '', array('print'));
$objPdf->selectFont(\Cx\Core\Core\Controller\Cx::instanciate()->getCodeBaseLibraryPath() . '/ezpdf/fonts/' . $this->font);
$objPdf->ezSetMargins(0, 0, 0, 0);
// Reset margins
$objPdf->setLineStyle(0.5);
$marginTop = 30;
$biggerCountTop = $biggerCountBottom = 0;
$arrHeaderLeft = $arrHeaderRight = $arrFooterLeft = $arrFooterRight = array();
if ($this->header) {
// header should be shown
$arrHeaderLeft = explode("\n", $this->header_left);
$arrHeaderRight = explode("\n", $this->header_right);
$countLeft = count($arrHeaderLeft);
$countRight = count($arrHeaderRight);
$biggerCountTop = $countLeft > $countRight ? $countLeft : $countRight;
$marginTop = $biggerCountTop * 14 + 36;
}
// Bottom margin
$marginBottom = 20;
$arrFooterRight = array();
if ($this->footer) {
// footer should be shown
// Old, obsolete:
$this->footer_left = str_replace('<--DATE-->', date(ASCMS_DATE_FORMAT_DATE, time()), $this->footer_left);
$this->footer_right = str_replace('<--DATE-->', date(ASCMS_DATE_FORMAT_DATE, time()), $this->footer_right);
// New:
$this->footer_left = str_replace('[DATE]', date(ASCMS_DATE_FORMAT_DATE, time()), $this->footer_left);
$this->footer_right = str_replace('[DATE]', date(ASCMS_DATE_FORMAT_DATE, time()), $this->footer_right);
$arrFooterLeft = explode("\n", $this->footer_left);
$arrFooterRight = explode("\n", $this->footer_right);
$countLeft = count($arrFooterLeft);
$countRight = count($arrFooterRight);
$biggerCountBottom = $countLeft > $countRight ? $countLeft : $countRight;
$marginBottom = $biggerCountBottom * 20 + 20;
}
// Borders
if ($this->border) {
$linesForAllPages = $objPdf->openObject();
$objPdf->saveState();
$objPdf->setStrokeColor(0, 0, 0, 1);
$objPdf->rectangle(10, 10, 575.28, 821.89);
$objPdf->restoreState();
$objPdf->closeObject();
$objPdf->addObject($linesForAllPages, 'all');
}
// Header
$headerArray = array();
$startpointY = 0;
if ($this->header) {
$objPdf->ezSetY(830);
$headerForAllPages = $objPdf->openObject();
$objPdf->saveState();
for ($i = 0; $i < $biggerCountTop; ++$i) {
$headerArray[$i] = array('left' => isset($arrHeaderLeft[$i]) ? $arrHeaderLeft[$i] : '', 'right' => isset($arrHeaderRight[$i]) ? $arrHeaderRight[$i] : '');
}
$tempY = $objPdf->ezTable($headerArray, '', '', array('showHeadings' => 0, 'fontSize' => $this->font_size_header, 'shaded' => 0, 'width' => 540, 'showLines' => 0, 'xPos' => 'center', 'xOrientation' => 'center', 'cols' => array('right' => array('justification' => 'right'))));
$tempY -= 5;
if ($this->border) {
$objPdf->setStrokeColor(0, 0, 0);
$objPdf->line(10, $tempY, 585.28, $tempY);
}
$startpointY = $tempY - 5;
$objPdf->restoreState();
$objPdf->closeObject();
$objPdf->addObject($headerForAllPages, 'all');
}
// Footer
$pageNumbersX = $pageNumbersY = $pageNumbersFont = 0;
if ($this->footer) {
$footerForAllPages = $objPdf->openObject();
$objPdf->saveState();
$tempY = $marginBottom - 5;
if ($this->border) {
$objPdf->setStrokeColor(0, 0, 0);
$objPdf->line(10, $tempY, 585.28, $tempY);
}
// length of the longest word
$longestWord = 0;
foreach ($arrFooterRight as $line) {
if ($longestWord < strlen($line)) {
$longestWord = strlen($line);
}
}
for ($i = $biggerCountBottom - 1; $i >= 0; --$i) {
//.........这里部分代码省略.........
示例4:
// Sort through the products
for ($i = 0, $n = sizeof($order->products); $i < $n; $i++) {
//$prod_str = $order->products[$i]['qty'] . " x " . $order->products[$i]['name'];
$prod_str = $order->products[$i]['name'];
change_color(PRODUCT_LISTING_BKGD_COLOR);
$pdf->filledRectangle(LEFT_MARGIN, $pos - PRODUCT_TABLE_ROW_HEIGHT, PRODUCT_TABLE_HEADER_WIDTH, PRODUCT_TABLE_ROW_HEIGHT);
$x = LEFT_MARGIN + PRODUCT_TABLE_LEFT_MARGIN;
$pos = $pos - PRODUCT_TABLE_ROW_HEIGHT + PRODUCT_TABLE_BOTTOM_MARGIN;
//page feed
if ($pos <= 30) {
$pdf->ezNewPage();
$pos = 780;
}
// end page feed
change_color(GENERAL_FONT_COLOR);
$pdf->rectangle(15, $pos - 2, 8, 8);
// $pdf->addText($x += PRODUCTS_COLUMN_SIZE,$pos,TABLE_HEADER_FONT_SIZE,$order->products[$i]['model']);
$pdf->addText($x, $pos, TABLE_HEADER_FONT_SIZE, $order->products[$i]['model']);
$truncated_str = $pdf->addTextWrap($x += MODEL_COLUMN_SIZE, $pos, PRODUCTS_COLUMN_SIZE, TABLE_HEADER_FONT_SIZE, $prod_str);
$pdf->addText($x += MODEL_COLUMN_SIZE + PRODUCTS_COLUMN_SIZE, $pos, TABLE_HEADER_FONT_SIZE, $order->products[$i]['qty']);
if ($billing_address_array[0] == $delivery_address_array[0]) {
//$pdf->addText($x += MODEL_COLUMN_SIZE,$pos,TABLE_HEADER_FONT_SIZE,$order->products[$i]['tax']);
$pdf->addText($x += MODEL_COLUMN_SIZE, $pos, TABLE_HEADER_FONT_SIZE, $currencies->format($order->products[$i]['final_price'], true, $order->info['currency'], $order->info['currency_value']));
//$pdf->addText($x += PRICING_COLUMN_SIZES,$pos,TABLE_HEADER_FONT_SIZE,$currencies->format(tep_add_tax($order->products[$i]['final_price'], $order->products[$i]['tax']), true, $order->info['currency'], $order->info['currency_value']));
$pdf->addText($x += PRICING_COLUMN_SIZES, $pos, TABLE_HEADER_FONT_SIZE, $currencies->format($order->products[$i]['final_price'] * $order->products[$i]['qty'], true, $order->info['currency'], $order->info['currency_value']));
//$pdf->addText($x += PRICING_COLUMN_SIZES,$pos,TABLE_HEADER_FONT_SIZE,$currencies->format(tep_add_tax($order->products[$i]['final_price'], $order->products[$i]['tax']) * $order->products[$i]['qty'], true, $order->info['currency'], $order->info['currency_value']));
}
$pos -= PRODUCT_TABLE_BOTTOM_MARGIN;
if ($truncated_str) {
change_color(PRODUCT_LISTING_BKGD_COLOR);
$pdf->filledRectangle(LEFT_MARGIN, $pos - PRODUCT_TABLE_ROW_HEIGHT, PRODUCT_TABLE_HEADER_WIDTH, PRODUCT_TABLE_ROW_HEIGHT);
示例5: kasten
function kasten(Cezpdf &$pdf, $anz_felder, $startx, $h, $b, $abstand_zw = null)
{
for ($a = 1; $a <= $anz_felder; $a++) {
if ($a == 1) {
$pdf->rectangle($startx, $pdf->y, $b, $h);
} else {
if ($abstand_zw != null) {
$startx += $abstand_zw;
}
$startx += $b;
$pdf->rectangle($startx, $pdf->y, $b, $h);
}
}
}
示例6: CREATEPDF
function CREATEPDF($p)
{
$sGeo = explode("|", $p);
$tokens = explode(",", $sGeo[0]);
$sMin = explode(" ", $tokens[0]);
$sMax = explode(" ", $tokens[2]);
$sMinX = $sMin[0];
$sMinY = $sMin[1];
$oPDF = new Cezpdf('a4', 'portrait') or die("Kan PDFLib niet gebruiken");
$oPDF->ezSetMargins(20, 20, 20, 20);
$oPDF->openHere('Fit');
$ext1 = $sMax[1] - $sMin[0];
$ext2 = $sMax[2] - $sMin[1];
$oPDF->setLineStyle(2);
$oPDF->rectangle(20, 20, 595.28 - 40, 841.89 - 40);
for ($iRecord = 1; $iRecord < count($sGeo) - 1; $iRecord++) {
$oPDF->setLineStyle(0.1);
$oPDF->setColor(1, 0, 0);
$oPDF->setStrokeColor(0.5, 0.5, 0.5);
$tokens = explode(",", $sGeo[$iRecord]);
$point = array();
$waarde = 0;
//$waardex = (297.64);
//$waardey = (420.945);
//$waardex = 0;
//$waardey = 0;
for ($gRecord = 0; $gRecord < count($tokens); $gRecord++) {
$sPunt = explode(" ", $tokens[$gRecord]);
if ($gRecord == 0) {
$sX = $sPunt[0] - $sMinX;
$sY = $sPunt[1] - $sMinY;
$point[$waarde] = $sX * 1000 / 0.3528 / 350000;
$point[$waarde + 1] = $sY * 1000 / 0.3528 / 350000;
} elseif ($gRecord == count($tokens) - 1) {
$sX = $sPunt[1] - $sMinX;
$sY = $sPunt[2] - $sMinY;
$point[$waarde] = $sX * 1000 / 0.3528 / 350000;
$point[$waarde + 1] = $sY * 1000 / 0.3528 / 350000;
} else {
$sX = $sPunt[1] - $sMinX;
$sY = $sPunt[2] - $sMinY;
$point[$waarde] = $sX * 1000 / 0.3528 / 350000;
$point[$waarde + 1] = $sY * 1000 / 0.3528 / 350000;
}
$waarde = $waarde + 2;
}
$oPDF->polygon($point, $waarde / 2, 1);
$oPDF->polygon($point, $waarde / 2);
unset($point);
}
$oPDF->ezStream();
}