本文整理汇总了PHP中FPDI::Close方法的典型用法代码示例。如果您正苦于以下问题:PHP FPDI::Close方法的具体用法?PHP FPDI::Close怎么用?PHP FPDI::Close使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类FPDI
的用法示例。
在下文中一共展示了FPDI::Close方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: Close
/**
* Close the document. This is called automatically by
* TCPDF::Output().
*/
public function Close()
{
// Print the Header & Footer
for ($page = 1; $page <= $this->getNumPages(); $page++) {
$this->setPage($page);
if (isset($this->headerFooterData[$page])) {
$record = $this->headerFooterData[$page];
if (is_array($this->headerFooterOptions['formats'])) {
foreach ($this->headerFooterOptions['formats'] as $id => $options) {
if ($options['position']['object'] == 'header_footer') {
$fieldOptions = $options;
$fieldOptions['position']['object'] = 'page';
$this->InFooter = TRUE;
// backup margins
$ml = $this->lMargin;
$mr = $this->rMargin;
$mt = $this->tMargin;
$this->SetMargins(0, 0, 0);
$this->drawContent($record, $fieldOptions, $this->view, $id);
$this->InFooter = FALSE;
// restore margins
$this->SetMargins($ml, $mt, $mr);
}
}
}
}
}
// call parent:
parent::Close();
}
示例2: emarking_pdf_count_pages
/**
* Extracts all pages in a big PDF file as separate PDF files, deleting the original PDF if successfull.
*
* @param unknown $newfile
* PDF file to extract
* @param unknown $tempdir
* Temporary folder
* @param string $doubleside
* Extract every two pages (for both sides scanning)
* @return number unknown number of pages extracted
*/
function emarking_pdf_count_pages($newfile, $tempdir, $doubleside = true)
{
global $CFG;
require_once $CFG->dirroot . "/mod/assign/feedback/editpdf/fpdi/fpdi2tcpdf_bridge.php";
require_once $CFG->dirroot . "/mod/assign/feedback/editpdf/fpdi/fpdi.php";
$doc = new FPDI();
$files = $doc->setSourceFile($newfile);
$doc->Close();
return $files;
}
示例3: Close
function Close()
{
parent::Close();
// clean up tmp files
foreach ($this->tmpFiles as $tmp) {
@unlink($tmp);
}
}
示例4: getPdfPagesCount
public static function getPdfPagesCount($filepaht) {
//require_once(Yii::app()->basePath.'/extensions/Fpdf/fpdf.php');
//require_once(Yii::app()->basePath.'/extensions/Fpdi/fpdi.php');
$pdf = new FPDI();
$pageCount = $pdf->setSourceFile($filepaht);
$pdf->Close();
return $pageCount;
}
示例5: generatePDF
//.........这里部分代码省略.........
$pdf->setXY(120, $y_start);
$pdf->Cell(20, 6, $ligne->qtt, "LR", 0, "C");
$pdf->Cell(30, 6, preg_replace("/\\./", ",", sprintf("%.2f" . EURO, $ligne->prix_ht)), "LR", 0, "R");
$pdf->Cell(30, 6, preg_replace("/\\./", ",", sprintf("%.2f" . EURO, $ligne->prix_ht * $ligne->qtt)), "LR", 0, "R");
$pdf->setXY(120, $y_start);
$pdf->Cell(20, $y - $y_start, '', "LR", 0, "C");
$pdf->Cell(30, $y - $y_start, '', "LR", 0, "R");
$pdf->Cell(30, $y - $y_start, '', "LR", 0, "R");
$total_ht += $ligne->prix_ht * $ligne->qtt;
$pdf->Ln();
$pdf->Cell(110, 2, "", "LR");
$pdf->Cell(20, 2, "", "LR");
$pdf->Cell(30, 2, "", "LR");
$pdf->Cell(30, 2, "", "LR");
$pdf->Ln();
}
$y_fin = $pdf->getY();
if ($y < 190) {
$pdf->Cell(110, 190 - $y, "", "LRB", 0, "C");
$pdf->Cell(20, 190 - $y, "", "LRB", 0, "C");
$pdf->Cell(30, 190 - $y, "", "LRB", 0, "C");
$pdf->Cell(30, 190 - $y, "", "LRB", 0, "C");
$pdf->Ln();
}
// Total HT
$txt_type_paiement = $facture->type_paiement;
if (preg_match('/eption de cette facture/', $txt_type_paiement) and $facture->language != 'fr_FR') {
$txt_type_paiement = _('upon receipt of invoice');
}
$pdf->SetFont('Arial', '', '11');
$pdf->Cell(130, 6, utf8_decode(_("Payment")) . " : " . $txt_type_paiement);
$pdf->Cell(30, 6, utf8_decode(_("Subtotal")), "", 0, "R");
$pdf->Cell(30, 6, preg_replace("/\\./", ",", sprintf("%.2f" . EURO, $total_ht)), "", 0, "R");
$pdf->Ln();
// TVA
$pdf->Cell(130, 6, "");
$pdf->Cell(30, 6, utf8_decode(_("VAT")) . " " . str_replace('.', ',', $facture->taxe) . "%", "", 0, "R");
$pdf->Cell(30, 6, preg_replace("/\\./", ",", sprintf("%.2f" . EURO, $facture->taxe / 100 * $total_ht)), "", 0, "R");
$pdf->Ln();
// Solde à régler
$pdf->SetFont('Arial', 'B', '11');
$pdf->Cell(130, 6, "");
$pdf->Cell(30, 6, utf8_decode(_('Total')), "", 0, "R");
$pdf->Cell(30, 6, preg_replace("/\\./", ",", sprintf("%.2f" . EURO, (1 + $facture->taxe / 100) * $total_ht - $facture->accompte)), "", 0, "R");
$pdf->Ln();
$pdf->Ln();
$pdf->SetFont('Arial', '', '8');
$pdf->MultiCell(190, 4, utf8_decode(_('Discount not practiced by the company. In case of default in the invoice due date, the client agrees to pay a penalty pursuant to the provisions of Article 1226 of the Civil Code, an increase of 15% in addition to the main total without any notice of default being required.')));
// Extra data
$pdf->SetFont('Arial', '', '10');
if (!empty($facture->extra_bottom)) {
$pdf->Ln(10);
$pdf->MultiCell(120, 6, $facture->extra_bottom, 0);
}
// RIB
$result = mysql_query('SELECT value ' . 'FROM webfinance_pref ' . 'WHERE id_pref=' . $facture->id_compte) or die(mysql_error());
list($cpt) = mysql_fetch_array($result);
mysql_free_result($result);
$cpt = unserialize(base64_decode($cpt));
if (!is_object($cpt)) {
echo "compte Impossible de generer la facture. <a " . "href='../admin/societe'>Vous devez saisir au moins un compte " . "bancaire dans les options pour emettre des factures</a>";
exit(1);
}
foreach ($cpt as $n => $v) {
$cpt->{$n} = utf8_decode($cpt->{$n});
}
$pdf->SetFont('Arial', 'B', '10');
$pdf->Ln();
$pdf->Cell(160, 6, utf8_decode(_("Bank references")) . " ", "LTR", 0, "C");
$pdf->Ln();
$pdf->SetFont('Arial', '', '8');
$pdf->Cell(35, 6, utf8_decode(_("Bank")) . " : ", "L");
$pdf->Cell(125, 6, $cpt->banque, "R");
$pdf->Ln();
$pdf->Cell(35, 6, "IBAN : ", "L");
$pdf->Cell(125, 6, $cpt->iban, "R");
$pdf->Ln();
$pdf->Cell(35, 6, "SWIFT/BIC : ", "LB");
$pdf->Cell(125, 6, $cpt->swift, "BR");
$pdf->Ln();
$pdf->SetAuthor($societe->raison_sociale);
$pdf->SetCreator('Webfinance $Id: gen_facture.php 532 2012-11-10 10:32:19Z pierre $ Using FPDF');
$pdf->SetSubject(ucfirst($facture->type_doc) . utf8_decode(_(' #')) . " " . $facture->num_facture . " " . utf8_decode(_("for")) . " " . $facture->nom_client);
$pdf->SetTitle(ucfirst($facture->type_doc) . utf8_decode(_(' #')) . " " . $facture->num_facture);
if ($target == 'file') {
$pdf->Output($filename, 'F');
} else {
$pdf->Output(basename($filename), 'I');
}
$pdf->Close();
// Delete temporary logo file
unlink($tempfile_logo);
global $language;
foreach (array(LC_MESSAGES, LC_TIME, LC_MONETARY, LC_CTYPE) as $locale) {
setlocale($locale, $language . ".UTF-8") or die("locale {$locale} language failed {$language}");
}
bindtextdomain('webfinance', dirname(__FILE__) . '/../../lang') or die("Set gettext bindtextdomain language failed\n");
textdomain('webfinance') or die("Set gettext textdomain language failed\n");
return $filename;
}