当前位置: 首页>>代码示例>>PHP>>正文


PHP FPDF::GetY方法代码示例

本文整理汇总了PHP中FPDF::GetY方法的典型用法代码示例。如果您正苦于以下问题:PHP FPDF::GetY方法的具体用法?PHP FPDF::GetY怎么用?PHP FPDF::GetY使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在FPDF的用法示例。


在下文中一共展示了FPDF::GetY方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: drawPDF

 public function drawPDF()
 {
     $pdf = new \FPDF('L', 'mm', 'Letter');
     $pdf->SetMargins(3.175, 3.175, 3.175);
     $pdf->SetAutoPageBreak(false);
     if (\COREPOS\Fannie\API\FanniePlugin::isEnabled('CoopDealsSigns')) {
         $this->font = 'Gill';
         $this->alt_font = 'GillBook';
         define('FPDF_FONTPATH', dirname(__FILE__) . '/../../../modules/plugins2.0/CoopDealsSigns/noauto/fonts/');
         $pdf->AddFont('Gill', '', 'GillSansMTPro-Medium.php');
     }
     $pdf->SetFont($this->font, '', 16);
     $data = $this->loadItems();
     $width = 136.52;
     $height = 105;
     $top = 90;
     $left = 15;
     $effective_width = $width - 2 * $left;
     foreach ($data as $item) {
         $pdf->AddPage();
         $column = 1;
         // right aligned
         $price = $this->printablePrice($item);
         $pdf->SetXY($left + $width * $column, $top);
         $pdf->SetFontSize($this->SMALL_FONT);
         $pdf->Cell($effective_width, 10, $item['brand'], 0, 1, 'C');
         $pdf->SetX($left + $width * $column);
         $pdf->SetFontSize($this->MED_FONT);
         $pdf->MultiCell($effective_width, 12, $item['description'], 0, 'C');
         $pdf->SetX($left + $width * $column);
         $pdf->SetFontSize($this->BIG_FONT);
         $pdf->Cell($effective_width, 25, $price, 0, 1, 'C');
         $y_pos = $pdf->GetY();
         if ($item['startDate'] != '' && $item['endDate'] != '') {
             // intl would be nice
             $datestr = $this->getDateString($item['startDate'], $item['endDate']);
             $pdf->SetXY($left + $width * $column, $top + ($height - 40));
             $pdf->SetFontSize($this->SMALL_FONT);
             $pdf->Cell($effective_width, 20, $datestr, 0, 1, 'R');
         }
         if ($item['originName'] != '') {
             $pdf->SetXY($left + $width * $column, $y_pos);
             $pdf->SetFontSize($this->SMALL_FONT);
             if (strlen($item['originName']) < 50) {
                 $pdf->Cell($effective_width, 20, $item['originName'], 0, 1, 'L');
             } else {
                 $pdf->Cell($effective_width, 20, $item['originShortName'], 0, 1, 'L');
             }
         }
     }
     $pdf->Output('WfcProdSingle.pdf', 'I');
 }
开发者ID:phpsmith,项目名称:IS4C,代码行数:52,代码来源:WfcProduceSingle.php

示例2: drawPDF

 public function drawPDF()
 {
     $pdf = new \FPDF('P', 'mm', 'Letter');
     $pdf->SetMargins(0, 3.175, 0);
     $pdf->SetAutoPageBreak(false);
     define('FPDF_FONTPATH', dirname(__FILE__) . '/noauto/fonts/');
     $pdf->AddFont('Gill', '', 'GillSansMTPro-Medium.php');
     $pdf->AddFont('Gill', 'B', 'GillSansMTPro-Heavy.php');
     $pdf->AddFont('GillBook', '', 'GillSansMTPro-Book.php');
     $pdf->SetFont('Gill', '', 16);
     $data = $this->loadItems();
     $count = 0;
     $sign = 0;
     $width = 53.975;
     $height = 68.95999999999999;
     $top = 20;
     $left = 5.175;
     $effective_width = $width - 2 * $left;
     $pdf->SetDrawColor(0, 0, 0);
     $pdf->SetLineWidth(0.2);
     foreach ($data as $item) {
         if ($count % 16 == 0) {
             $pdf->AddPage();
             // draw tick marks for cutting
             $pdf->Line(2, $height + 1.5, 6, $height + 1.5);
             $pdf->Line(2, 2 * $height + 1.5, 6, 2 * $height + 1.5);
             $pdf->Line(2, 3 * $height + 1.5, 6, 3 * $height + 1.5);
             $pdf->Line($width, 2, $width, 6);
             $pdf->Line(2 * $width, 2, 2 * $width, 6);
             $pdf->Line(3 * $width, 2, 3 * $width, 6);
             $pdf->Line($width, 4 * $height - 4, $width, 4 * $height);
             $pdf->Line(2 * $width, 4 * $height - 4, 2 * $width, 4 * $height);
             $pdf->Line(3 * $width, 4 * $height - 4, 3 * $width, 4 * $height);
             $pdf->Line(4 * $width - 6, $height + 1.5, 4 * $width - 2, $height + 1.5);
             $pdf->Line(4 * $width - 6, 2 * $height + 1.5, 4 * $width - 2, 2 * $height + 1.5);
             $pdf->Line(4 * $width - 6, 3 * $height + 1.5, 4 * $width - 2, 3 * $height + 1.5);
             $sign = 0;
         }
         $row = floor($sign / 4);
         $column = $sign % 4;
         $price = $item['normal_price'];
         if ($item['scale']) {
             if (substr($price, 0, 1) != '$') {
                 $price = sprintf('$%.2f', $price);
             }
             $price .= ' /lb.';
         } elseif (isset($item['signMultiplier'])) {
             $price = $this->formatPrice($item['normal_price'], $item['signMultiplier']);
         } else {
             $price = $this->formatPrice($item['normal_price']);
         }
         $pdf->Image(dirname(__FILE__) . '/cd_head_16.png', $left - 2 + $width * $column, $top - 17 + $row * $height, $width - 6);
         $pdf->SetXY($left + $width * $column, $top + $row * $height - 2);
         $pdf->SetFont('Gill', 'B', $this->SMALL_FONT);
         $font_shrink = 0;
         while (true) {
             $pdf->SetX($left + $width * $column);
             $y = $pdf->GetY();
             $pdf->MultiCell($effective_width, 6, strtoupper($item['brand']), 0, 'C');
             if ($pdf->GetY() - $y > 6) {
                 $pdf->SetFillColor(0xff, 0xff, 0xff);
                 $pdf->Rect($left + $width * $column, $y, $left + $width * $column + $effective_width, $pdf->GetY(), 'F');
                 $font_shrink++;
                 if ($font_shrink >= $this->SMALL_FONT) {
                     break;
                 }
                 $pdf->SetFontSize($this->MED_FONT - $font_shrink);
                 $pdf->SetXY($left + $width * $column, $y);
             } else {
                 break;
             }
         }
         $pdf->SetX($left + $width * $column);
         $pdf->SetFont('Gill', '', $this->MED_FONT);
         $font_shrink = 0;
         while (true) {
             $pdf->SetX($left + $width * $column);
             $y = $pdf->GetY();
             $pdf->MultiCell($effective_width, 6, $item['description'], 0, 'C');
             if ($pdf->GetY() - $y > 12) {
                 $pdf->SetFillColor(0xff, 0xff, 0xff);
                 $pdf->Rect($left + $width * $column, $y, $left + $width * $column + $effective_width, $pdf->GetY(), 'F');
                 $font_shrink++;
                 if ($font_shrink >= $this->MED_FONT) {
                     break;
                 }
                 $pdf->SetFontSize($this->MED_FONT - $font_shrink);
                 $pdf->SetXY($left + $width * $column, $y);
             } else {
                 if ($pdf->GetY() - $y < 12) {
                     $words = explode(' ', $item['description']);
                     $multi = '';
                     for ($i = 0; $i < floor(count($words) / 2); $i++) {
                         $multi .= $words[$i] . ' ';
                     }
                     $multi = trim($multi) . "\n";
                     for ($i = floor(count($words) / 2); $i < count($words); $i++) {
                         $multi .= $words[$i] . ' ';
                     }
                     $item['description'] = trim($multi);
//.........这里部分代码省略.........
开发者ID:phpsmith,项目名称:IS4C,代码行数:101,代码来源:CoopDeals16UpDarkP.php

示例3: genpdf

function genpdf($typefacture, $datefacture, $nofacture, $montant, $civilite, $client, $contact, $chrono, $today)
{
    $pdf = new FPDF("P", "mm", "A4");
    $pdf->AddPage();
    $pdf->SetMargins(20, 20);
    $pdf->AddFont("Arialb", "", "arialb.php");
    //$pdf->AddFont("Courier","","arialb.php");
    /////////////////////////////////////en tete////////////////////////////////////////
    //logo
    $pdf->SetXY(18, 24);
    $X = $pdf->GetX();
    $Y = $pdf->GetY();
    $pdf->Image("img/logo.jpg", $X, $Y, 23, 19, "jpg");
    //Commune de Faa"a
    $pdf->SetXY(42, 22);
    $X = $pdf->GetX();
    $Y = $pdf->GetY();
    $pdf->SetFont("Arialb", "", 13);
    $pdf->Cell(55, 10, utf8_decode("COMMUNE DE FAA'A"));
    $pdf->SetXY($X + 1, $Y + 8);
    $pdf->SetFont("Arial", "", 12);
    $pdf->Cell(55, 5, utf8_decode("N° {$chrono}/DAF/FTR-Régie-hp"), 1, 1, "C");
    //$X=$pdf->GetX();
    $Y = $pdf->GetY();
    $pdf->SetXY($X, $Y);
    $pdf->SetFont("Arial", "", 9);
    $pdf->Cell(55, 5, utf8_decode("Affaire suivie par : Hinatini Parker"), 0, 1);
    $Y = $pdf->GetY();
    $pdf->SetXY($X, $Y);
    $pdf->SetFont("Arial", "", 9);
    $pdf->Cell(55, 3, utf8_decode("Téléphone : 800 960 poste 421"), 0, 0);
    ///////////////////////////////////fin en tete/////////////////////////////////////
    ///////////////////////////////////colonne droite/////////////////////////////////
    //Date
    $pdf->SetXY($X + 100, $Y);
    $pdf->SetFont("Arial", "", 10);
    $pdf->Cell(55, 3, "Faa'a le " . $today, 0);
    ///////////////////////////////////fin colonne droite////////////////////////////
    /////////////////////////////////info exp/dest //////////////////////////////////////
    //Le Maire
    $pdf->SetY(60);
    $pdf->SetFont("times", "", 18);
    $pdf->Cell(0, 10, "Le Maire", 0, 1, "C");
    //Destinataire
    $pdf->SetY(70);
    $pdf->SetFont("Arial", "", 10);
    $pdf->Multicell(0, 5, utf8_decode("à\n{$client}\n{$contact}"), 0, "C");
    $currentY = $pdf->GetY();
    $pdf->SetY($currentY + 10);
    $pdf->SetFont("Arialb", "U", 10);
    $pdf->Cell(20, 5, utf8_decode("Objet :"), 0, 0, "L");
    $pdf->SetFont("Arialb", "", 10);
    $pdf->Cell(0, 5, utf8_decode("Relance des factures impayées"), 0, 1, "L");
    $pdf->SetFont("Arial", "U", 10);
    $pdf->Cell(20, 5, utf8_decode("N/Réf :"), 0, 0, "L");
    $pdf->SetFont("Arial", "", 10);
    $pdf->Cell(0, 5, utf8_decode("Facture {$typefacture} N° {$nofacture} du {$datefacture}"), 0, 1, "L");
    $Y = $pdf->GetY();
    $pdf->SetY($Y + 20);
    $text = "{$civilite},\n\nJe vous informe que, sauf erreur de ma part, vous présentez un impayé " . "envers la Commune de FAA'A d'un montant de {$montant} FCP au titre de la (des) {$typefacture}.\n\n" . "Aussi, je vous demande de bien vouloir vous rapprocher de la Régie municipale pour vous acquitter de la somme due.\n\n" . "A défaut de réponse de votre part dans un délai de 45 jours à compter de la date du présent courrier," . "votre dossier sera transmis en contentieux à la Trésorerie des Iles du Vent, des Australes et des Archipels pour commandement de payer.\n\n" . "La Régie reste à votre disposition au 800.960 poste 421 pour toute entente préalable avant poursuite.\n\n" . "Je vous prie d'agréer, {$civilite}, l'expression de mes salutations distinguées";
    $pdf->Multicell(0, 5, utf8_decode($text), 0, "L");
    $pdf->Image("img/marianne.jpg", 150, 220, 31, 31, "jpg");
    ////////////////////////////////information////////////////////////////////////
    $pdf->Line(20, 273, 190, 273);
    $pdf->SetXY(20, 273);
    $pdf->SetFont("Arial", "", 7);
    $pdf->Cell(0, 3, utf8_decode("PK 4 côté mer - BP 60 002 - 98702 Faa’a Centre - Tahiti / Tél. : (689) 800 960 - Télécopie : (689) 834 890 - E-mail : mairiefaaa@mail.pf\n"), 0, 0, "C");
    ////////////////////////////////fin information////////////////////////////////////
    $pdf->Output();
}
开发者ID:BGCX067,项目名称:faaa-multifac-svn-to-git,代码行数:70,代码来源:create_relance.php

示例4: save

	/**
	 * Save PHPExcel to file
	 *
	 * @param 	string 		$pFileName
	 * @throws 	Exception
	 */
	public function save($pFilename = null) {
		// Open file
		global $cnf;
		$pFilename= $cnf['path']['Temp'] . $pFilename;

		$fileHandle = fopen($pFilename, 'w');
		if ($fileHandle === false) {
			throw new Exception("Could not open file $pFilename for writing.");
		}

		// Fetch sheets
		$sheets = array();
		if (is_null($this->_sheetIndex)) {
			$sheets = $this->_phpExcel->getAllSheets();
		} else {
			$sheets[] = $this->_phpExcel->getSheet($this->_sheetIndex);
		}

    	// PDF paper size
    	$paperSize = 'A4';

		// Create PDF
		$pdf = new FPDF('P', 'pt', $paperSize);

		// Loop all sheets
		foreach ($sheets as $sheet) {
	    	// PDF orientation
	    	$orientation = 'P';
	    	if ($sheet->getPageSetup()->getOrientation() == PHPExcel_Worksheet_PageSetup::ORIENTATION_LANDSCAPE) {
		    	$orientation = 'L';
	    	}

			// Start sheet
			$pdf->SetAutoPageBreak(true);
			$pdf->SetFont('Arial', '', 10);
			$pdf->AddPage($orientation);

	    	// Get worksheet dimension
	    	$dimension = explode(':', $sheet->calculateWorksheetDimension());
	    	$dimension[0] = PHPExcel_Cell::coordinateFromString($dimension[0]);
	    	$dimension[0][0] = PHPExcel_Cell::columnIndexFromString($dimension[0][0]) - 1;
	    	$dimension[1] = PHPExcel_Cell::coordinateFromString($dimension[1]);
	    	$dimension[1][0] = PHPExcel_Cell::columnIndexFromString($dimension[1][0]) - 1;

	    	// Calculate column widths
	    	$sheet->calculateColumnWidths();

	    	// Loop trough cells
	    	for ($row = $dimension[0][1]; $row <= $dimension[1][1]; $row++) {
	    		// Line height
	    		$lineHeight = 0;

	    		// Calulate line height
	    		for ($column = $dimension[0][0]; $column <= $dimension[1][0]; $column++) {
	    		    $rowDimension = $sheet->getRowDimension($row);
	    			$cellHeight = PHPExcel_Shared_Drawing::pixelsToPoints(
	    				PHPExcel_Shared_Drawing::cellDimensionToPixels($rowDimension->getRowHeight())
	    			);
	    			if ($cellHeight <= 0) {
		    			$cellHeight = PHPExcel_Shared_Drawing::pixelsToPoints(
		    				PHPExcel_Shared_Drawing::cellDimensionToPixels($sheet->getDefaultRowDimension()->getRowHeight())
		    			);
	    			}
	    			if ($cellHeight <= 0) {
	    				$cellHeight = $sheet->getStyleByColumnAndRow($column, $row)->getFont()->getSize();
	    			}
	    			if ($cellHeight > $lineHeight) {
	    				$lineHeight = $cellHeight;
	    			}
	    		}

	    		// Output values
	    		for ($column = $dimension[0][0]; $column <= $dimension[1][0]; $column++) {
	    			// Start with defaults...
	    			$pdf->SetFont('Arial', '', 10);
	    			$pdf->SetTextColor(0, 0, 0);
	    			$pdf->SetDrawColor(100, 100, 100);
	    			$pdf->SetFillColor(255, 255, 255);

			    	// Coordinates
			    	$startX = $pdf->GetX();
			    	$startY = $pdf->GetY();

	    			// Cell exists?
	    			$cellData = '';
	    			if ($sheet->cellExistsByColumnAndRow($column, $row)) {
	    				if ($sheet->getCellByColumnAndRow($column, $row)->getValue() instanceof PHPExcel_RichText) {
	    					$cellData = $sheet->getCellByColumnAndRow($column, $row)->getValue()->getPlainText();
	    				} else {
		    				if ($this->_preCalculateFormulas) {
		    					$cellData = PHPExcel_Style_NumberFormat::ToFormattedString(
		    						$sheet->getCellByColumnAndRow($column, $row)->getCalculatedValue(),
		    						$sheet->getstyle( $sheet->getCellByColumnAndRow($column, $row)->getCoordinate() )->getNumberFormat()->getFormatCode()
		    					);
//.........这里部分代码省略.........
开发者ID:Jtgadbois,项目名称:Pedadida,代码行数:101,代码来源:PDF.php

示例5: CreatePDFRendering

 private function CreatePDFRendering($name, $company, $file)
 {
     $pdf = new FPDF('L', 'pt', array(162, 288));
     //2.25"x4"
     $pdf->AddPage();
     $pdf->SetFont('Arial', 'B', 22);
     //name font style
     $pdf->Cell(0, 22, $name, 0, 1, 'C');
     //name
     $pdf->Cell(0, 10, '', 0, 1, 'C');
     //blank line
     $pdf->SetFont('Arial', 'I', 16);
     //company font style
     $pdf->Cell(0, 16, $company, 0, 1, 'C');
     //company name
     $pdf->Cell(0, 28, '', 0, 1, 'C');
     //blank line
     $pdf->Image('images/logo.png', $pdf->GetX() + 165, $pdf->GetY(), 65);
     if ($file == true) {
         //set file name to hash of object
         $fullpath = $this->savedirectory . md5(spl_object_hash($pdf)) . '.pdf';
         $pdf->Output($fullpath, 'F');
         $pdf->Close();
         $cmd = 'lpr ' . $fullpath;
         $cmdout = shell_exec($cmd);
         return $fullpath;
     } else {
         return $pdf->Output();
     }
 }
开发者ID:ukanalyst,项目名称:DymoVmugCheckin,代码行数:30,代码来源:NameTagPrinter.php

示例6: count

 $payment = $arRow['payments'];
 $detail = $details[$selAddW[0]][$trans];
 if (strstr($detail[0], "Gazette Ad")) {
     $gazette = True;
 }
 $lineitem = count($detail) == 1 ? $detail[0] : '(multiple items)';
 if ($lineitem == "ARPAYMEN") {
     $lineitem = "Payment Received - Thank You";
 }
 $pdf->Cell(20, 8, '', 0, 0, 'L');
 $pdf->Cell(60, 8, $date, 0, 0, 'L');
 //$pdf->Cell(40,8,date('M-d-Y',$date),0,0,'L');
 $pdf->Cell(20, 8, $trans, 0, 0, 'L');
 $pdf->Cell(25, 8, '$ ' . sprintf('%.2f', $charges), 0, 0, 'L');
 $pdf->Cell(25, 8, '$ ' . sprintf('%.2f', $payment), 0, 0, 'L');
 if ($pdf->GetY() > 265) {
     addBackPage($pdf);
     $pdf->AddPage();
 } else {
     $pdf->Ln(5);
 }
 if (!empty($lineitem)) {
     $pdf->SetFontSize(10);
     $pdf->Cell(30, 8, '', 0, 0, 'L');
     $pdf->Cell(60, 8, $lineitem, 0, 0, 'L');
     if ($pdf->GetY() > 265) {
         addBackPage($pdf);
         $pdf->AddPage();
     } else {
         $pdf->Ln(5);
     }
开发者ID:phpsmith,项目名称:IS4C,代码行数:31,代码来源:makeStatement.php

示例7: drawPDF

 public function drawPDF()
 {
     $pdf = new \FPDF('L', 'mm', 'Letter');
     $pdf->SetMargins(3.175, 3.175, 3.175);
     $pdf->SetAutoPageBreak(false);
     define('FPDF_FONTPATH', dirname(__FILE__) . '/noauto/fonts/');
     $pdf->AddFont('Gill', '', 'GillSansMTPro-Medium.php');
     $pdf->AddFont('Gill', 'B', 'GillSansMTPro-Heavy.php');
     $pdf->AddFont('GillBook', '', 'GillSansMTPro-Book.php');
     $pdf->SetFont('Gill', '', 16);
     $data = $this->loadItems();
     $count = 0;
     $sign = 0;
     $width = 68.67;
     $height = 71;
     $top = 22;
     $left = 6.0;
     $effective_width = $width - $left;
     foreach ($data as $item) {
         if ($count % 12 == 0) {
             if ($count != 0) {
                 // draw tick marks again
                 // sometimes other content of the page
                 // overwrites them
                 $pdf->Line(2, $height + 0.0, 6, $height + 0.0);
                 $pdf->Line(2, 2 * $height + 1.0, 6, 2 * $height + 1.0);
                 $pdf->Line(4 * $width - 3, $height + 0.0, 4 * $width + 1, $height + 0.0);
                 $pdf->Line(4 * $width - 3, 2 * $height + 1.0, 4 * $width + 1, 2 * $height + 1.0);
                 $pdf->Line($width + 1.5, 2, $width + 1.5, 8);
                 $pdf->Line(2 * $width + 1.5, 2, 2 * $width + 1.5, 8);
                 $pdf->Line(3 * $width + 1.5, 2, 3 * $width + 1.5, 8);
                 $pdf->Line($width + 1.5, 3 * $height - 6, $width + 1.5, 3 * $height);
                 $pdf->Line(2 * $width + 1.5, 3 * $height - 6, 2 * $width + 1.5, 3 * $height);
                 $pdf->Line(3 * $width + 1.5, 3 * $height - 6, 3 * $width + 1.5, 3 * $height);
             }
             $pdf->AddPage();
             // draw tick marks for cutting
             $pdf->Line(2, $height + 0.0, 6, $height + 0.0);
             $pdf->Line(2, 2 * $height + 1.0, 6, 2 * $height + 1.0);
             $pdf->Line(4 * $width - 3, $height + 0.0, 4 * $width + 1, $height + 0.0);
             $pdf->Line(4 * $width - 3, 2 * $height + 1.0, 4 * $width + 1, 2 * $height + 1.0);
             $pdf->Line($width + 1.5, 2, $width + 1.5, 8);
             $pdf->Line(2 * $width + 1.5, 2, 2 * $width + 1.5, 8);
             $pdf->Line(3 * $width + 1.5, 2, 3 * $width + 1.5, 8);
             $pdf->Line($width + 1.5, 3 * $height - 6, $width + 1.5, 3 * $height);
             $pdf->Line(2 * $width + 1.5, 3 * $height - 6, 2 * $width + 1.5, 3 * $height);
             $pdf->Line(3 * $width + 1.5, 3 * $height - 6, 3 * $width + 1.5, 3 * $height);
             $sign = 0;
         }
         $row = floor($sign / 4);
         $column = $sign % 4;
         $price = $item['normal_price'];
         if ($item['scale']) {
             if (substr($price, 0, 1) != '$') {
                 $price = sprintf('$%.2f', $price);
             }
             $price .= ' /lb.';
         } elseif (isset($item['signMultiplier'])) {
             $price = $this->formatPrice($item['normal_price'], $item['signMultiplier']);
         } else {
             $price = $this->formatPrice($item['normal_price']);
         }
         $pdf->Image(dirname(__FILE__) . '/cd_head_16.png', $left - 1 + $width * $column, $top - 19 + $row * $height, $width - 6);
         $pdf->SetXY($left + $width * $column, $top + $row * $height + 1);
         $pdf->SetFont('Gill', 'B', $this->SMALL_FONT);
         $pdf->MultiCell($effective_width, 6, strtoupper($item['brand']), 0, 'C');
         /**
           This block attempts to write the description then
           checks how many lines it took. If the description was
           longer than two lines, it whites the whole thing out,
           drops one font size, and tries again. Calculating
           effective text size with smart line breaks seems
           really tough.
         */
         $pdf->SetFont('Gill', '', $this->MED_FONT);
         $font_shrink = 0;
         while (true) {
             $pdf->SetX($left + $width * $column);
             $y = $pdf->GetY();
             $pdf->MultiCell($effective_width, 7, $item['description'], 0, 'C');
             if ($pdf->GetY() - $y > 14) {
                 $pdf->SetFillColor(0xff, 0xff, 0xff);
                 $pdf->Rect($left + $width * $column, $y, $left + $width * $column + $effective_width, $pdf->GetY(), 'F');
                 $font_shrink++;
                 if ($font_shrink >= $this->MED_FONT) {
                     break;
                 }
                 $pdf->SetFontSize($this->MED_FONT - $font_shrink);
                 $pdf->SetXY($left + $width * $column, $y);
             } else {
                 if ($pdf->GetY() - $y < 14) {
                     $words = explode(' ', $item['description']);
                     $multi = '';
                     for ($i = 0; $i < floor(count($words) / 2); $i++) {
                         $multi .= $words[$i] . ' ';
                     }
                     $multi = trim($multi) . "\n";
                     for ($i = floor(count($words) / 2); $i < count($words); $i++) {
                         $multi .= $words[$i] . ' ';
                     }
//.........这里部分代码省略.........
开发者ID:phpsmith,项目名称:IS4C,代码行数:101,代码来源:CoopDeals12UpDarkL.php

示例8: FPDF

$db->_DEBUG = 1;
$pdf = new FPDF("L", 'mm', "A4");
$pdf->open();
$pdf->AddPage();
$fonte = 'times';
$pdf->SetLeftMargin(5);
$pdf->SetAutoPageBreak("on", 2);
$pdf->SetFont($fonte, "", 12);
$pdf->sety(15);
$pdf->SetFont($fonte, "b", 12);
$pdf->setx(5);
$pdf->ln();
$pdf->SetFont($fonte, "", 14);
$pdf->setx(5);
$pdf->cell(50, 5, "Controle de Entregas", 0, 1);
$pdf->line(5, $pdf->GetY(), 290, $pdf->GetY());
$pdf->ln(10);
$pdf->setfont($fonte, "B", "14");
$pdf->cell(0, 5, $_GET["dtvenda"], 0, 1, "C");
$pdf->setfillcolor(235);
$pdf->SetFont($fonte, "b", 10);
$total = $db->entregas["total"];
$sql = " SELECT fun_nome,count(*) as total\n         FROM   comandas inner join comandaentrega \n                on cet_comid = com_id\n                inner join funcionarios on fun_id = cet_funid\n         WHERE com_dtcomanda = '" . strformat($_GET["dtvenda"], "dten") . "' group by fun_nome order by fun_nome";
$rs = $db->executa($sql);
$pdf->cell(140, 5, "Funcionário", "B", 0, "C", 1);
$pdf->cell(45, 5, "Qtde", "B", 1, "C", 1);
$pdf->SetFont($fonte, "", 10);
while ($ln = $db->fetch_array($rs)) {
    if ($pdf->getY() >= $pdf->h - 15) {
        $pdf->addpage();
        $pdf->SetFont($fonte, "b", 10);
开发者ID:tavo1981,项目名称:phpbar,代码行数:31,代码来源:del_rctrlentregas002.php

示例9: date

 //display date
 $pdf->SetFont('Arial', 'B', 12);
 $pdf->Cell(20, 5, date("Y/m/d"), 0, 1, "C");
 //add new row
 $pdf->Cell(210, 5, '', 0, 1, "C");
 //Explora academy title
 $pdf->SetFont('Helvetica', '', 25);
 $pdf->Cell(200, 15, 'Explora Academy of Design', 0, 1, "C");
 //add new row
 $pdf->Cell(210, 5, '', 0, 1, "C");
 $pdf->SetFont('Arial', '', 12);
 $pdf->SetTextColor(0, 0, 0);
 //nata and all 3 courses
 $pdf->Cell(80, 5, '', 0, 0, "C");
 if (strtoupper($course) == "NATA") {
     $pdf->Cell(10, 5, $pdf->Image($image12, $pdf->GetX(), $pdf->GetY(), 10, 5), 1, 0, 'L', false);
     $pdf->Cell(15, 5, 'NATA', 0, 1, "C");
 } else {
     $pdf->Cell(10, 5, '', 1, 0, "C");
     $pdf->Cell(15, 5, 'NATA', 0, 1, "C");
 }
 $pdf->Cell(1, 1, '', 0, 1, "C");
 $pdf->Cell(210, 4, '', 0, 1, "C");
 $pdf->SetFont('Arial', '', 12);
 $pdf->SetTextColor(0, 0, 0);
 $pdf->Cell(80, 0, '', 0, 0, "C");
 if (strtoupper($course) == "INTERIOR DESIGN") {
     $pdf->Cell(10, 5, $pdf->Image($image12, $pdf->GetX(), $pdf->GetY(), 10, 5), 1, 0, 'L', false);
     $pdf->Cell(41, 5, 'INTERIOR DESIGN', 0, 1, "C");
 } else {
     $pdf->Cell(10, 5, '', 1, 0, "C");
开发者ID:shailshah9,项目名称:Explora.in,代码行数:31,代码来源:sendmail1.php

示例10: getSettingValue

		$pdf->Cell(90,5, ($gepiSchoolAdress2),0,2,'');

	}

	$gepiSchoolZipCode = getSettingValue('gepiSchoolZipCode');
	$gepiSchoolCity = getSettingValue('gepiSchoolCity');
	$pdf->Cell(90,5, ($gepiSchoolZipCode." ".$gepiSchoolCity),0,2,'');
	$gepiSchoolTel = getSettingValue('gepiSchoolTel');
	$gepiSchoolFax = getSettingValue('gepiSchoolFax');

	$passealaligne = '0';
	// entête téléphone
			// emplacement du cadre télécome
			$x_telecom = $pdf->GetX();
			$y_telecom = $pdf->GetY();

	if( $entente_tel==='1' )
	{

		$grandeur = '';
		$text_tel = '';

		if ( $tel_image != '' )
		{

			$a = $pdf->GetX();
			$b = $pdf->GetY();
			$ima = '../../images/imabulle/'.$tel_image.'.jpg';
			$valeurima=redimensionne_image($ima, 15, 15);
			$pdf->Image($ima, $a, $b, $valeurima[0], $valeurima[1]);
开发者ID:rhertzog,项目名称:lcs,代码行数:30,代码来源:bilan_absences_quotidien_pdf.php

示例11: Report

         the others to the right of this one.  Maybe make the comment cell full
         width. **/
     $pdf->Cell($catw, $sh, $grade['category_name'], 0, 0, 'L', 1);
     $pdf->Cell($scorew, $sh, $grade['score'] . "/" . $grade['max_score'], 0, 0, 'C', 1);
     $pdf->Cell($weightw, $sh, $grade['assignment_weight'], 0, 0, 'C', 1);
     $pdf->Cell($avgw, $sh, $grade['avg'], 0, 1, 'C', 1);
     if ($assignInfo['comment'] != '') {
         $pdf->SetFont('Times', 'I', 8);
         $pdf->Cell($datew, $sh, '', 0, 0, 'L', 1);
         $lines = $pdf->GetStringWidth($grade['comment']) / ($pw - $datew);
         $h = $lines * $sh;
         $pdf->MultiCell($pw - $datew, $sh, $grade['comment'], 0, 'L', 1);
         $pdf->SetFont('Times', '', 8);
     }
     /** $x_coord = $pdf->GetX();**/
     $y_coord = $pdf->GetY();
     $rcv++;
 }
 /* determine if custom score chart will fit on current page */
 if ($y_coord + $sh * count($custom_scores) > 10) {
     $pdf->AddPage();
     $pdf->SetTextColor(51, 102, 102);
     $pdf->SetFont('Times', 'B', $titlefs);
     $pdf->SetXY($lm, $tm);
     $pdf->Cell($headingw, $titleh, 'Questar III Student Progress Report (Contd.)', 0, 1, 'C', 0);
     $y_coord = $tm + $titleh;
 }
 $pdf->SetXY($x_coord, $y_coord);
 $pdf->SetFillColor(255, 255, 255);
 $pdf->SetTextColor(0, 0, 0);
 $pdf->SetFont('Times', '', 8);
开发者ID:knichel,项目名称:AIT,代码行数:31,代码来源:printview_progressreport.php

示例12:

 $pdf->AddPage();
 $pdf->setleftmargin(10);
 $pdf->setX(20);
 $pdf->setY(10);
 $pdf->SetFillColor(0, 0, 0);
 $pdf->Cell(190, 140, '', 1, 0, "C");
 $pdf->setX(20);
 $pdf->setY(15);
 $pdf->SetFillColor(0, 0, 0);
 $image1 = 'logo.png';
 // Add some text
 $pdf->SetFont('Arial', '', 20);
 // width, height, text, no border, next line - below & left margin, alignement
 // shree rang in centre
 $pdf->Cell(175, 10, '           Explora Academy of Design', 0, 0, "C");
 $pdf->Cell(15, 10, $pdf->Image($image1, $pdf->GetX(), $pdf->GetY(), 10), 0, 1, 'R', false);
 $pdf->SetFillColor(0, 0, 0);
 $pdf->Rect(20, 26, 175, 1, 'F');
 $pdf->Cell(10, 8, '', 0, 1, "C");
 //set font and height
 $pdf->SetFont('Arial', '', 12);
 $pdf->SetTextColor(0, 0, 0);
 //space before form no.
 $pdf->Cell(20, 10, '', 0, 0, "C");
 $pdf->Cell(20, 7, 'RECEIPT NUMBER:', 0, 0, "C");
 //space between rect and form no tag
 $pdf->Cell(15, 10, '', 0, 0, "C");
 // create box for form
 $pdf->Cell(30, 7, $form, 1, 0, "C");
 //space after box
 $pdf->Cell(30, 10, '', 0, 0, "C");
开发者ID:shailshah9,项目名称:Explora.in,代码行数:31,代码来源:sendmail.php

示例13: drawPDF

 public function drawPDF()
 {
     $pdf = new \FPDF('P', 'mm', 'Letter');
     if (\COREPOS\Fannie\API\FanniePlugin::isEnabled('CoopDealsSigns')) {
         $this->font = 'Gill';
         $this->alt_font = 'GillBook';
         define('FPDF_FONTPATH', dirname(__FILE__) . '/../../../modules/plugins2.0/CoopDealsSigns/noauto/fonts/');
         $pdf->AddFont('Gill', '', 'GillSansMTPro-Medium.php');
         $pdf->AddFont('Gill', 'B', 'GillSansMTPro-Heavy.php');
     }
     $width = 52;
     // tag width in mm
     $height = 31;
     // tag height in mm
     $left = 6;
     // left margin
     $top = 16;
     // top margin
     $pdf->SetTopMargin($top);
     //Set top margin of the page
     $pdf->SetLeftMargin($left);
     //Set left margin of the page
     $pdf->SetRightMargin($left);
     //Set the right margin of the page
     $pdf->SetAutoPageBreak(False);
     // manage page breaks yourself
     $data = $this->loadItems();
     $num = 0;
     // count tags
     $x = $left;
     $y = $top;
     foreach ($data as $item) {
         // extract & format data
         $price = $item['normal_price'];
         $desc = strtoupper(substr($item['posDescription'], 0, 25));
         $brand = ucwords(strtolower(substr($item['brand'], 0, 13)));
         $pak = $item['units'];
         $size = $item['units'] . "-" . $item['size'];
         $sku = $item['sku'];
         $ppu = $item['pricePerUnit'];
         $vendor = substr($item['vendor'], 0, 7);
         $upc = $item['upc'];
         if ($num % 32 == 0) {
             $pdf->AddPage();
             $x = $left;
             $y = $top;
         } else {
             if ($num % 4 == 0) {
                 $x = $left;
                 $y += $height;
             }
         }
         $pdf->SetFont($this->font, '', 8);
         $pdf->SetXY($x, $y);
         // try normal wordwrap
         // but squeeze into two lines if needed
         $wrapped = wordwrap($desc, 12, "\n", true);
         if (count(explode("\n", $wrapped)) > 2) {
             $wrapped = substr($desc, 0, 12);
             if ($wrapped[11] != ' ') {
                 $wrapped .= '-';
             }
             $wrapped .= "\n";
             $wrapped .= trim(substr($desc, 12));
         }
         $pdf->MultiCell($width / 2, 3, $wrapped, 0, 'L');
         $pdf->SetX($x);
         $pdf->Cell($width / 2, 3, date('n/j/y ') . $size, 0, 1, 'L');
         $pdf->SetFont($this->font, 'B', 18);
         //change font for price
         $pdf->SetX($x);
         $pdf->Cell($width / 2, 8, $price, 0, 1, 'L');
         $args = array('height' => 7, 'align' => 'L', 'fontsize' => 8, 'width' => 0.23, 'font' => $this->font);
         $b_y = $pdf->GetY();
         $pdf = $this->drawBarcode($upc, $pdf, $x, $b_y, $args);
         // move right by tag width
         $x += $width;
         $num++;
     }
     $pdf->Output('Tags4x8P.pdf', 'I');
 }
开发者ID:phpsmith,项目名称:IS4C,代码行数:81,代码来源:HalfTags4x8P.php

示例14: parse_pdf_content

function parse_pdf_content($content, $member_id)
{
    // parse text content from Smarty to pdf content
    global $db, $config, $t;
    $pdf_content = '';
    $margins = array(mm_to_pt(20), mm_to_pt(20), mm_to_pt(20), mm_to_pt(20));
    //left, top, right, bottom (in points) 56pt ~= 20mm
    $font_size = 14;
    //points
    $pdf = new FPDF('P', 'pt', 'A4');
    // portrait, A4
    $pdf->SetCompression(false);
    $pdf->SetMargins($margins[0], $margins[1], $margins[2]);
    //only left, top, right margins. bottom margin equals to 20mm by default.
    $pdf->SetTitle('Your Invoice');
    $pdf->SetSubject('*** Your Payment');
    $pdf->SetAuthor('aMember');
    $pdf->AddPage();
    $pdf->SetFont('Arial', '', $font_size);
    $current_x = $pdf->GetX();
    $current_y = $pdf->GetY();
    $width = mm_to_pt(210);
    $height = mm_to_pt(270);
    $width = $width - $margins[0] - $margins[2];
    // target width
    $height = $height - $margins[1] - $margins[3];
    // target height
    $image = $config['root_dir'] . "/logo.jpg";
    // logo path to include in pdf at top-right corner
    if (is_file($image)) {
        $size = getimagesize($image);
        $x = $width - $size[0] + $margins[0];
        $y = $current_y;
        $pdf->Image($image, $x, $y, $size[0], $size[1]);
        // use original size
        $current_y += $size[1];
    }
    $current_y += $font_size;
    //pt
    $contacts = explode("\n", $config['invoice_contacts']);
    // output contact information right-aligned
    $max_length = 0;
    foreach ($contacts as $row) {
        $row = trim($row);
        $length = $pdf->GetStringWidth($row);
        if ($length > $max_length) {
            $max_length = $length;
        }
    }
    $x = $width - $max_length + $margins[0];
    $y = $current_y;
    foreach ($contacts as $row) {
        $row = trim($row);
        $attr = get_font_styles($row);
        $pdf->SetFont('Arial', $attr, $font_size);
        $pdf->Text($x, $y, strip_tags($row));
        $y += $font_size;
    }
    $current_y = $y;
    $pdf->SetFont('Arial', '', $font_size);
    //return font settings
    // customer contacts
    $u = $db->get_user($member_id);
    if (!$t) {
        $t =& new_smarty();
    }
    $t->assign('u', $u);
    $cust_contacts = $t->fetch('mail_receipt_contact.pdf.txt');
    $cust_contacts = explode("\n", $cust_contacts);
    // output contact information left-aligned
    $num_rows = count($contacts);
    $x = $margins[0];
    $y = $current_y - $font_size * $num_rows;
    // $num_rows rows up from contact information and output customer data
    foreach ($cust_contacts as $row) {
        $row = trim($row);
        $attr = get_font_styles($row);
        $pdf->SetFont('Arial', $attr, $font_size);
        $pdf->Text($x, $y, strip_tags($row));
        $y += $font_size;
    }
    $current_y = $y;
    /*
    $y = $current_y - $font_size * 4; // 4 rows up from contact information and output customer data
    
    $string = $u['name_f'] . ' ' . $u['name_l'];
    $pdf->Text ($x, $y, $string);
    $y += $font_size;
    
    $string = $u['street'];
    $pdf->Text ($x, $y, $string);
    $y += $font_size;
    
    $string = $u['zip'] . ' ' . $u['city'];
    $pdf->Text ($x, $y, $string);
    $y += $font_size;
    
    	$state = db_getStateByCode($u['country'], $u['state']);
    	$country = db_getCountryByCode($u['country']);
    $string = $state .  ' '  . $country;
//.........这里部分代码省略.........
开发者ID:subashemphasize,项目名称:test_site,代码行数:101,代码来源:common.inc.php

示例15: FPDF

 function __construct($lineItems, $lineItemTotals, $filename, $save = false)
 {
     App::import('vendor', 'fpdf/fpdf');
     $orientation = 'P';
     $unit = 'pt';
     $format = 'A4';
     $margin = 40;
     $pdf = new FPDF($orientation, $unit, $format);
     App::import('Helper', 'Time');
     $timeHelper = new TimeHelper();
     setlocale(LC_MONETARY, 'th_TH');
     $pdf->AddPage();
     $pdf->SetTopMargin($margin);
     $pdf->SetLeftMargin($margin);
     $pdf->SetRightMargin($margin);
     $pdf->SetAutoPageBreak(true, $margin);
     $pdf->SetY($pdf->GetY() + 60);
     $pdf->SetFont('Arial', 'B', 10);
     $pdf->SetTextColor(0);
     $pdf->SetFillColor(255);
     $pdf->SetLineWidth(1);
     $pdf->SetFont('Arial', 'B', '10');
     $current_y = $pdf->GetY();
     $current_x = $pdf->GetX();
     $cell_width = 30;
     $pdf->MultiCell($cell_width, 25, "No.\n ", 'LTR', 'C');
     $pdf->SetXY($current_x + $cell_width, $current_y);
     $pdf->Cell(250, 25, "Description", 'LTR', 0, 'C');
     $current_y = $pdf->GetY();
     $current_x = $pdf->GetX();
     $cell_width = 48;
     $pdf->MultiCell($cell_width, 25, "# Ordered", 'LTR', 'C');
     $pdf->SetXY($current_x + $cell_width, $current_y);
     $current_y = $pdf->GetY();
     $current_x = $pdf->GetX();
     $cell_width = 48;
     $pdf->MultiCell($cell_width, 25, "# Supplied", 'LTR', 'C');
     $pdf->SetXY($current_x + $cell_width, $current_y);
     $current_y = $pdf->GetY();
     $current_x = $pdf->GetX();
     $cell_width = 70;
     $pdf->MultiCell($cell_width, 25, "Amount Wholesale", 'LTR', 'C');
     $pdf->SetXY($current_x + $cell_width, $current_y);
     $current_y = $pdf->GetY();
     $current_x = $pdf->GetX();
     $cell_width = 70;
     $pdf->MultiCell($cell_width, 25, "Amount Retail", 'LTR', 'C');
     $pdf->SetY($pdf->GetY() - 25);
     $pdf->SetFont('Arial', '');
     $pdf->SetFillColor(238);
     $pdf->SetLineWidth(0.2);
     $pdf->SetY($pdf->GetY() + 25);
     $num = 1;
     $number_ordered = 0;
     $number_supplied = 0;
     foreach ($lineItems as $lineItem) {
         $pdf->Cell(30, 20, $num++, 1, 0, 'L');
         $pdf->Cell(250, 20, $lineItem['Product']['short_description'], 1, 0, 'L');
         $pdf->Cell(48, 20, $lineItem['LineItem']['ordered'], 1, 0, 'R');
         $pdf->Cell(48, 20, $lineItem['LineItem']['supplied'], 1, 0, 'R');
         $pdf->Cell(70, 20, money_format("%i", $lineItem['LineItem']['amount_wholesale']), 1, 0, 'R');
         $pdf->Cell(70, 20, money_format("%i", $lineItem['LineItem']['amount_retail']), 1, 1, 'R');
     }
     $pdf->SetX($pdf->GetX() + 30);
     $pdf->SetFont('Arial', 'B');
     $pdf->Cell(250, 20, "TOTALS", 1);
     $pdf->SetFont('Arial', '');
     $pdf->Cell(48, 20, $lineItemTotals['LineItem']['ordered'], 1, 0, 'R');
     $pdf->Cell(48, 20, $lineItemTotals['LineItem']['ordered'], 1, 0, 'R');
     $pdf->Cell(70, 20, money_format("%i", $lineItemTotals['LineItem']['amount_wholesale']), 1, 0, 'R');
     $pdf->Cell(70, 20, money_format("%i", $lineItemTotals['LineItem']['amount_retail']), 1, 1, 'R');
     if ($save) {
         $pdf->Output($filename, 'F');
     } else {
         $pdf->Output($filename, 'I');
     }
 }
开发者ID:sunny36,项目名称:grecocos,代码行数:77,代码来源:supplier_batch_report.php


注:本文中的FPDF::GetY方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。