本文整理汇总了PHP中PDF::line方法的典型用法代码示例。如果您正苦于以下问题:PHP PDF::line方法的具体用法?PHP PDF::line怎么用?PHP PDF::line使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类PDF
的用法示例。
在下文中一共展示了PDF::line方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1:
/**
* Affiche la grille des lignes de factures
*
* @param PDF $pdf Object PDF
* @param int $tab_top Tab top
* @param int $tab_height Tab height
* @param int $nexY next y
* @param Translate $outputlangs Output langs
* @return void
*/
function _tableau(&$pdf, $tab_top, $tab_height, $nexY, $outputlangs)
{
global $conf;
$default_font_size = pdf_getPDFFontSize($outputlangs);
// Amount in (at tab_top - 1)
$pdf->SetTextColor(0, 0, 0);
$pdf->SetFont('', '', $default_font_size - 2);
$titre = $outputlangs->transnoentities("AmountInCurrency", $outputlangs->transnoentitiesnoconv("Currency" . $conf->currency));
$pdf->SetXY($this->page_largeur - $this->marge_droite - ($pdf->GetStringWidth($titre) + 4), $tab_top - 4);
$pdf->MultiCell($pdf->GetStringWidth($titre) + 3, 2, $titre);
$pdf->SetDrawColor(128, 128, 128);
// Rect prend une longueur en 3eme param
$pdf->Rect($this->marge_gauche, $tab_top, $this->page_largeur - $this->marge_gauche - $this->marge_droite, $tab_height);
// line prend une position y en 3eme param
$pdf->line($this->marge_gauche, $tab_top + 5, $this->page_largeur - $this->marge_droite, $tab_top + 5);
$pdf->SetFont('', '', 8);
// Accountancy piece
$pdf->SetXY($this->posxpiece - 1, $tab_top + 1);
$pdf->MultiCell($this->posxdesc - $this->posxpiece - 1, 1, '', '', 'R');
// Comments
$pdf->line($this->posxdesc - 1, $tab_top, $this->posxdesc - 1, $tab_top + $tab_height);
$pdf->SetXY($this->posxdesc - 1, $tab_top + 1);
$pdf->MultiCell($this->posxdate - $this->posxdesc - 1, 1, $outputlangs->transnoentities("Description"), '', 'L');
// Date
$pdf->line($this->posxdate - 1, $tab_top, $this->posxdate - 1, $tab_top + $tab_height);
$pdf->SetXY($this->posxdate - 1, $tab_top + 1);
$pdf->MultiCell($this->posxtype - $this->posxdate - 1, 2, $outputlangs->transnoentities("Date"), '', 'C');
// Type
$pdf->line($this->posxtype - 1, $tab_top, $this->posxtype - 1, $tab_top + $tab_height);
$pdf->SetXY($this->posxtype - 1, $tab_top + 1);
$pdf->MultiCell($this->posxprojet - $this->posxtype - 1, 2, $outputlangs->transnoentities("Type"), '', 'C');
// Project
$pdf->line($this->posxprojet - 1, $tab_top, $this->posxprojet - 1, $tab_top + $tab_height);
$pdf->SetXY($this->posxprojet - 1, $tab_top + 1);
$pdf->MultiCell($this->posxtva - $this->posxprojet - 1, 2, $outputlangs->transnoentities("Project"), '', 'C');
// VAT
if (empty($conf->global->MAIN_GENERATE_DOCUMENTS_WITHOUT_VAT)) {
$pdf->line($this->posxtva - 1, $tab_top, $this->posxtva - 1, $tab_top + $tab_height);
$pdf->SetXY($this->posxtva - 1, $tab_top + 1);
$pdf->MultiCell($this->posxup - $this->posxtva - 1, 2, $outputlangs->transnoentities("VAT"), '', 'C');
}
// Unit price
$pdf->line($this->posxup - 1, $tab_top, $this->posxup - 1, $tab_top + $tab_height);
$pdf->SetXY($this->posxup - 1, $tab_top + 1);
$pdf->MultiCell($this->posxqty - $this->posxup - 1, 2, $outputlangs->transnoentities("PriceU"), '', 'C');
// Quantity
$pdf->line($this->posxqty - 1, $tab_top, $this->posxqty - 1, $tab_top + $tab_height);
$pdf->SetXY($this->posxqty - 1, $tab_top + 1);
$pdf->MultiCell($this->postotalttc - $this->posxqty, 2, $outputlangs->transnoentities("Qty"), '', 'R');
// Total with all taxes
$pdf->line($this->postotalttc, $tab_top, $this->postotalttc, $tab_top + $tab_height);
$pdf->SetXY($this->postotalttc - 1, $tab_top + 1);
$pdf->MultiCell($this->page_largeur - $this->marge_droite - $this->postotalttc, 2, $outputlangs->transnoentities("TotalTTC"), '', 'R');
$pdf->SetTextColor(0, 0, 0);
}
示例2: Facture
/**
* Show payments table
*
* @param PDF $pdf Object PDF
* @param Object $object Object invoice
* @param int $posy Position y in PDF
* @param Translate $outputlangs Object langs for output
* @return int <0 if KO, >0 if OK
*/
function _tableau_versements(&$pdf, $object, $posy, $outputlangs)
{
global $conf;
$sign = 1;
if ($object->type == 2 && !empty($conf->global->INVOICE_POSITIVE_CREDIT_NOTE)) {
$sign = -1;
}
$tab3_posx = 120;
$tab3_top = $posy + 8;
$tab3_width = 80;
$tab3_height = 4;
if ($this->page_largeur < 210) {
$tab3_posx -= 20;
}
$default_font_size = pdf_getPDFFontSize($outputlangs);
$title = $outputlangs->transnoentities("PaymentsAlreadyDone");
if ($object->type == 2) {
$title = $outputlangs->transnoentities("PaymentsBackAlreadyDone");
}
$pdf->SetFont('', '', $default_font_size - 3);
$pdf->SetXY($tab3_posx, $tab3_top - 4);
$pdf->MultiCell(60, 3, $title, 0, 'L', 0);
$pdf->line($tab3_posx, $tab3_top, $tab3_posx + $tab3_width, $tab3_top);
$pdf->SetFont('', '', $default_font_size - 4);
$pdf->SetXY($tab3_posx, $tab3_top);
$pdf->MultiCell(20, 3, $outputlangs->transnoentities("Payment"), 0, 'L', 0);
$pdf->SetXY($tab3_posx + 21, $tab3_top);
$pdf->MultiCell(20, 3, $outputlangs->transnoentities("Amount"), 0, 'L', 0);
$pdf->SetXY($tab3_posx + 40, $tab3_top);
$pdf->MultiCell(20, 3, $outputlangs->transnoentities("Type"), 0, 'L', 0);
$pdf->SetXY($tab3_posx + 58, $tab3_top);
$pdf->MultiCell(20, 3, $outputlangs->transnoentities("Num"), 0, 'L', 0);
$pdf->line($tab3_posx, $tab3_top - 1 + $tab3_height, $tab3_posx + $tab3_width, $tab3_top - 1 + $tab3_height);
$y = 0;
$pdf->SetFont('', '', $default_font_size - 4);
// Loop on each deposits and credit notes included
$sql = "SELECT re.rowid, re.amount_ht, re.amount_tva, re.amount_ttc,";
$sql .= " re.description, re.fk_facture_source,";
$sql .= " f.type, f.datef";
$sql .= " FROM " . MAIN_DB_PREFIX . "societe_remise_except as re, " . MAIN_DB_PREFIX . "facture as f";
$sql .= " WHERE re.fk_facture_source = f.rowid AND re.fk_facture = " . $object->id;
$resql = $this->db->query($sql);
if ($resql) {
$num = $this->db->num_rows($resql);
$i = 0;
$invoice = new Facture($this->db);
while ($i < $num) {
$y += 3;
$obj = $this->db->fetch_object($resql);
if ($obj->type == 2) {
$text = $outputlangs->trans("CreditNote");
} elseif ($obj->type == 3) {
$text = $outputlangs->trans("Deposit");
} else {
$text = $outputlangs->trans("UnknownType");
}
$invoice->fetch($obj->fk_facture_source);
$pdf->SetXY($tab3_posx, $tab3_top + $y);
$pdf->MultiCell(20, 3, dol_print_date($obj->datef, 'day', false, $outputlangs, true), 0, 'L', 0);
$pdf->SetXY($tab3_posx + 21, $tab3_top + $y);
$pdf->MultiCell(20, 3, price($obj->amount_ttc, 0, $outputlangs), 0, 'L', 0);
$pdf->SetXY($tab3_posx + 40, $tab3_top + $y);
$pdf->MultiCell(20, 3, $text, 0, 'L', 0);
$pdf->SetXY($tab3_posx + 58, $tab3_top + $y);
$pdf->MultiCell(20, 3, $invoice->ref, 0, 'L', 0);
$pdf->line($tab3_posx, $tab3_top + $y + 3, $tab3_posx + $tab3_width, $tab3_top + $y + 3);
$i++;
}
} else {
$this->error = $this->db->lasterror();
return -1;
}
// Loop on each payment
$sql = "SELECT p.datep as date, p.fk_paiement as type, p.num_paiement as num, pf.amount as amount,";
$sql .= " cp.code";
$sql .= " FROM " . MAIN_DB_PREFIX . "paiement_facture as pf, " . MAIN_DB_PREFIX . "paiement as p";
$sql .= " LEFT JOIN " . MAIN_DB_PREFIX . "c_paiement as cp ON p.fk_paiement = cp.id";
$sql .= " WHERE pf.fk_paiement = p.rowid AND pf.fk_facture = " . $object->id;
$sql .= " ORDER BY p.datep";
$resql = $this->db->query($sql);
if ($resql) {
$num = $this->db->num_rows($resql);
$i = 0;
while ($i < $num) {
$y += 3;
$row = $this->db->fetch_object($resql);
$pdf->SetXY($tab3_posx, $tab3_top + $y);
$pdf->MultiCell(20, 3, dol_print_date($this->db->jdate($row->date), 'day', false, $outputlangs, true), 0, 'L', 0);
$pdf->SetXY($tab3_posx + 21, $tab3_top + $y);
$pdf->MultiCell(20, 3, price($sign * $row->amount, 0, $outputlangs), 0, 'L', 0);
$pdf->SetXY($tab3_posx + 40, $tab3_top + $y);
//.........这里部分代码省略.........
示例3:
/**
* Show table for lines
*
* @param PDF $pdf Object PDF
* @param string $tab_top Top position of table
* @param string $tab_height Height of table (rectangle)
* @param int $nexY Y
* @param Translate $outputlangs Langs object
* @param int $hidetop Hide top bar of array
* @param int $hidebottom Hide bottom bar of array
* @return void
*/
function _tableau(&$pdf, $tab_top, $tab_height, $nexY, $outputlangs, $hidetop = 0, $hidebottom = 0)
{
global $conf, $mysoc;
$default_font_size = pdf_getPDFFontSize($outputlangs);
$pdf->SetDrawColor(128, 128, 128);
// Rect prend une longueur en 3eme param
$pdf->Rect($this->marge_gauche, $tab_top, $this->page_largeur - $this->marge_gauche - $this->marge_droite, $tab_height);
// line prend une position y en 3eme param
$pdf->line($this->marge_gauche, $tab_top + 6, $this->page_largeur - $this->marge_droite, $tab_top + 6);
$pdf->SetTextColor(0, 0, 0);
$pdf->SetFont('', '', $default_font_size);
$pdf->SetXY($this->posxref, $tab_top + 1);
$pdf->MultiCell($this->posxlabel - $this->posxref, 3, $outputlangs->transnoentities("Tasks"), '', 'L');
$pdf->SetXY($this->posxlabel, $tab_top + 1);
$pdf->MultiCell($this->posxworkload - $this->posxlabel, 3, $outputlangs->transnoentities("Description"), 0, 'L');
$pdf->SetXY($this->posxworkload, $tab_top + 1);
$pdf->MultiCell($this->posxprogress - $this->posxworkload, 3, $outputlangs->transnoentities("PlannedWorkloadShort"), 0, 'R');
$pdf->SetXY($this->posxprogress, $tab_top + 1);
$pdf->MultiCell($this->posxdatestart - $this->posxprogress, 3, '%', 0, 'R');
$pdf->SetXY($this->posxdatestart, $tab_top + 1);
$pdf->MultiCell($this->posxdateend - $this->posxdatestart, 3, '', 0, 'C');
$pdf->SetXY($this->posxdateend, $tab_top + 1);
$pdf->MultiCell($this->page_largeur - $this->marge_droite - $this->posxdatestart, 3, '', 0, 'C');
}
示例4: pdf_bank
/**
* Show bank informations for PDF generation
*
* @param PDF $pdf Object PDF
* @param Translate $outputlangs Object lang
* @param int $curx X
* @param int $cury Y
* @param Account $account Bank account object
* @param int $onlynumber Output only number (bank+desk+key+number according to country, but without name of bank and domiciliation)
* @param int $default_font_size Default font size
* @return float The Y PDF position
*/
function pdf_bank(&$pdf, $outputlangs, $curx, $cury, $account, $onlynumber = 0, $default_font_size = 10)
{
global $mysoc, $conf;
$diffsizetitle = empty($conf->global->PDF_DIFFSIZE_TITLE) ? 3 : $conf->global->PDF_DIFFSIZE_TITLE;
$diffsizecontent = empty($conf->global->PDF_DIFFSIZE_CONTENT) ? 4 : $conf->global->PDF_DIFFSIZE_CONTENT;
$pdf->SetXY($curx, $cury);
if (empty($onlynumber)) {
$pdf->SetFont('', 'B', $default_font_size - $diffsizetitle);
$pdf->MultiCell(100, 3, $outputlangs->transnoentities('PaymentByTransferOnThisBankAccount') . ':', 0, 'L', 0);
$cury += 4;
}
$outputlangs->load("banks");
// Use correct name of bank id according to country
$bickey = "BICNumber";
if ($account->getCountryCode() == 'IN') {
$bickey = "SWIFT";
}
// Get format of bank account according to its country
$usedetailedbban = $account->useDetailedBBAN();
//$onlynumber=0; $usedetailedbban=1; // For tests
if ($usedetailedbban) {
$savcurx = $curx;
if (empty($onlynumber)) {
$pdf->SetFont('', '', $default_font_size - $diffsizecontent);
$pdf->SetXY($curx, $cury);
$pdf->MultiCell(100, 3, $outputlangs->transnoentities("Bank") . ': ' . $outputlangs->convToOutputCharset($account->bank), 0, 'L', 0);
$cury += 3;
}
if (empty($conf->global->PDF_BANK_HIDE_NUMBER_SHOW_ONLY_BICIBAN)) {
// Note:
// bank = code_banque (FR), sort code (GB, IR. Example: 12-34-56)
// desk = code guichet (FR), used only when $usedetailedbban = 1
// number = account number
// key = check control key used only when $usedetailedbban = 1
if (empty($onlynumber)) {
$pdf->line($curx + 1, $cury + 1, $curx + 1, $cury + 6);
}
if ($usedetailedbban == 1) {
$fieldstoshow = array('bank', 'desk', 'number', 'key');
if ($conf->global->BANK_SHOW_ORDER_OPTION == 1) {
$fieldstoshow = array('bank', 'desk', 'key', 'number');
}
} else {
if ($usedetailedbban == 2) {
$fieldstoshow = array('bank', 'number');
} else {
dol_print_error('', 'Value returned by function useDetailedBBAN not managed');
}
}
foreach ($fieldstoshow as $val) {
if ($val == 'bank') {
// Bank code
$tmplength = 18;
$pdf->SetXY($curx, $cury + 4);
$pdf->SetFont('', '', $default_font_size - 3);
$pdf->MultiCell($tmplength, 3, $outputlangs->convToOutputCharset($account->code_banque), 0, 'C', 0);
$pdf->SetXY($curx, $cury + 1);
$curx += $tmplength;
$pdf->SetFont('', 'B', $default_font_size - 4);
$pdf->MultiCell($tmplength, 3, $outputlangs->transnoentities("BankCode"), 0, 'C', 0);
if (empty($onlynumber)) {
$pdf->line($curx, $cury + 1, $curx, $cury + 7);
}
}
if ($val == 'desk') {
// Desk
$tmplength = 18;
$pdf->SetXY($curx, $cury + 4);
$pdf->SetFont('', '', $default_font_size - 3);
$pdf->MultiCell($tmplength, 3, $outputlangs->convToOutputCharset($account->code_guichet), 0, 'C', 0);
$pdf->SetXY($curx, $cury + 1);
$curx += $tmplength;
$pdf->SetFont('', 'B', $default_font_size - 4);
$pdf->MultiCell($tmplength, 3, $outputlangs->transnoentities("DeskCode"), 0, 'C', 0);
if (empty($onlynumber)) {
$pdf->line($curx, $cury + 1, $curx, $cury + 7);
}
}
if ($val == 'number') {
// Number
$tmplength = 24;
$pdf->SetXY($curx, $cury + 4);
$pdf->SetFont('', '', $default_font_size - 3);
$pdf->MultiCell($tmplength, 3, $outputlangs->convToOutputCharset($account->number), 0, 'C', 0);
$pdf->SetXY($curx, $cury + 1);
$curx += $tmplength;
$pdf->SetFont('', 'B', $default_font_size - 4);
$pdf->MultiCell($tmplength, 3, $outputlangs->transnoentities("BankAccountNumber"), 0, 'C', 0);
//.........这里部分代码省略.........
示例5:
/**
* Show table for lines
*
* @param PDF $pdf Object PDF
* @param string $tab_top Top position of table
* @param string $tab_height Height of table (rectangle)
* @param int $nexY Y
* @param Translate $outputlangs Langs object
* @param int $hidetop Hide top bar of array
* @param int $hidebottom Hide bottom bar of array
* @return void
*/
function _tableau(&$pdf, $tab_top, $tab_height, $nexY, $outputlangs, $hidetop = 0, $hidebottom = 0)
{
global $langs;
$default_font_size = pdf_getPDFFontSize($outputlangs);
$langs->load("main");
$langs->load("bills");
if (empty($hidetop)) {
$pdf->SetFont('', 'B', $default_font_size - 2);
$pdf->SetXY(10, $tab_top);
$pdf->MultiCell(10, 5, "LS", 0, 'C', 1);
$pdf->line(20, $tab_top, 20, $tab_top + $tab_height);
$pdf->SetXY(20, $tab_top);
$pdf->MultiCell(10, 5, "LR", 0, 'C', 1);
$pdf->line(30, $tab_top, 30, $tab_top + $tab_height);
$pdf->SetXY(30, $tab_top);
$pdf->MultiCell(20, 5, $outputlangs->transnoentities("Ref"), 0, 'C', 1);
$pdf->SetXY(50, $tab_top);
$pdf->MultiCell(90, 5, $outputlangs->transnoentities("Description"), 0, 'L', 1);
$pdf->SetXY(140, $tab_top);
$pdf->MultiCell(30, 5, $outputlangs->transnoentities("QtyOrdered"), 0, 'C', 1);
$pdf->SetXY(170, $tab_top);
$pdf->MultiCell(30, 5, $outputlangs->transnoentities("QtyToShip"), 0, 'C', 1);
}
$pdf->Rect(10, $tab_top, 190, $tab_height);
}
示例6:
$pdf->setAutoPageBreak(TRUE, 45);
$pdf->AddPage('P', 'A4');
$pdf->SetFont('helvetica', 'B', 13);
$pdf->SetY(56);
$pdf->Cell(125, 8, $supp->getName(), 0, 0, 'L');
$pdf->SetFont('helvetica', 'B', 14);
$pdf->Cell(100, 8, "DC NO: {$dcno}", 0, 1, 'L');
$pdf->SetFont('helvetica', '', 13);
$pdf->Cell(125, 8, $supp->getAddressl1(), 0, 0, 'L');
$pdf->Cell(100, 8, "Date: {$dcdate}", 0, 1, 'L');
$pdf->Cell(125, 8, $supp->getAddressl2(), 0, 0, 'L');
$pdf->Cell(100, 8, "Your Ref: {$cref}", 0, 1, 'L');
$pdf->Cell(125, 8, "Phone No: " . $supp->getPhoneNo(), 0, 0, 'L');
$pdf->Cell(100, 8, "Date: {$crefdate}", 0, 1, 'L');
$pdf->ln();
$pdf->line(0, 87, 220, 87);
//line before mode of dispatch
$pdf->setY(86);
$pdf->MultiCell(125, 16, "Please receive the following materials and acknowledge the receipt", 0, 'L', 0, 0, '', '', true, 0, false, true, 16, 'M', true);
$pdf->Cell(100, 8, "Mode Of Dispatch: {$dmode}", 0, 1, 'L');
$pdf->Cell(125, 8, "", 0, 0, 'L');
$pdf->Cell(100, 8, "Status: {$dctype}", 0, 1, 'L');
$pdf->SetFont('helvetica', '', 10);
$pdf->Cell(150, 8, '', 0, 1, 'L');
$pdf->line(0, 101, 220, 101);
//line after mode of dispatch
$pdf->line(135, 55, 135, 101);
//vertical line b/w address and dc no
$pdf->line(135, 72, 220, 72);
//horizontal line b/w dc no and cust ref
$pdf->SetFont('helvetica', 'B', 11);
示例7: while
/**
* Show payments table
*
* @param PDF $pdf Object PDF
* @param Object $object Object invoice
* @param int $posy Position y in PDF
* @param Translate $outputlangs Object langs for output
* @return int <0 if KO, >0 if OK
*/
function _tableau_versements(&$pdf, $object, $posy, $outputlangs)
{
$tab3_posx = 120;
$tab3_top = $posy + 8;
$tab3_width = 80;
$tab3_height = 4;
if ($this->page_largeur < 210) {
$tab3_posx -= 20;
}
$default_font_size = pdf_getPDFFontSize($outputlangs);
$pdf->SetFont('', '', $default_font_size - 3);
$pdf->SetXY($tab3_posx, $tab3_top - 4);
$pdf->MultiCell(60, 3, $outputlangs->transnoentities("PaymentsAlreadyDone"), 0, 'L', 0);
$pdf->line($tab3_posx, $tab3_top, $tab3_posx + $tab3_width, $tab3_top);
$pdf->SetFont('', '', $default_font_size - 4);
$pdf->SetXY($tab3_posx, $tab3_top);
$pdf->MultiCell(20, 3, $outputlangs->transnoentities("Payment"), 0, 'L', 0);
$pdf->SetXY($tab3_posx + 21, $tab3_top);
$pdf->MultiCell(20, 3, $outputlangs->transnoentities("Amount"), 0, 'L', 0);
$pdf->SetXY($tab3_posx + 40, $tab3_top);
$pdf->MultiCell(20, 3, $outputlangs->transnoentities("Type"), 0, 'L', 0);
$pdf->SetXY($tab3_posx + 58, $tab3_top);
$pdf->MultiCell(20, 3, $outputlangs->transnoentities("Num"), 0, 'L', 0);
$pdf->line($tab3_posx, $tab3_top - 1 + $tab3_height, $tab3_posx + $tab3_width, $tab3_top - 1 + $tab3_height);
$y = 0;
$pdf->SetFont('', '', $default_font_size - 4);
// Loop on each payment
$sql = "SELECT p.datep as date, p.fk_paiement as type, p.num_paiement as num, pf.amount as amount,";
$sql .= " cp.code";
$sql .= " FROM " . MAIN_DB_PREFIX . "paiementfourn_facturefourn as pf, " . MAIN_DB_PREFIX . "paiementfourn as p";
$sql .= " LEFT JOIN " . MAIN_DB_PREFIX . "c_paiement as cp ON p.fk_paiement = cp.id";
$sql .= " WHERE pf.fk_paiementfourn = p.rowid and pf.fk_facturefourn = " . $object->id;
$sql .= " ORDER BY p.datep";
$resql = $this->db->query($sql);
if ($resql) {
$num = $this->db->num_rows($resql);
$i = 0;
while ($i < $num) {
$y += 3;
$row = $this->db->fetch_object($resql);
$pdf->SetXY($tab3_posx, $tab3_top + $y);
$pdf->MultiCell(20, 3, dol_print_date($this->db->jdate($row->date), 'day', false, $outputlangs, true), 0, 'L', 0);
$pdf->SetXY($tab3_posx + 21, $tab3_top + $y);
$pdf->MultiCell(20, 3, price($row->amount), 0, 'L', 0);
$pdf->SetXY($tab3_posx + 40, $tab3_top + $y);
$oper = $outputlangs->transnoentitiesnoconv("PaymentTypeShort" . $row->code);
$pdf->MultiCell(20, 3, $oper, 0, 'L', 0);
$pdf->SetXY($tab3_posx + 58, $tab3_top + $y);
$pdf->MultiCell(30, 3, $row->num, 0, 'L', 0);
$pdf->line($tab3_posx, $tab3_top + $y + 3, $tab3_posx + $tab3_width, $tab3_top + $y + 3);
$i++;
}
} else {
$this->error = $this->db->lasterror();
dol_syslog($this->db, $this->error, LOG_ERR);
return -1;
}
}
示例8: PDF
}
}
$pdf = new PDF(PDF_PAGE_ORIENTATION, PDF_UNIT, PDF_PAGE_FORMAT, true, 'UTF-8', false);
//$pdf->AliasNbPages();
$pdf->setAutoPageBreak(TRUE, 45);
$pdf->AddPage('P', 'A4');
$pdf->SetFont('helvetica', 'B', 13);
$pdf->SetY(56);
$pdf->SetFont('helvetica', 'B', 11);
$pdf->setY(100);
$pdf->Cell(20, 8, "SL NO", 0, 0, 'L');
$pdf->Cell(80, 8, "Description", 0, 0, 'L');
$pdf->Cell(20, 8, "Qty", 0, 0, 'C');
$pdf->Cell(30, 8, "Unit Price " . $currency, 0, 0, 'C');
$pdf->Cell(30, 8, "Discount", 0, 0, 'C');
$pdf->line(0, 110, 220, 110);
//line after slno, desc and remarks
$pdf->ln(6);
$j = 0;
while ($j < count($description)) {
if ($description[$j] != '') {
$pdf->ln(8);
$pdf->Cell(10, 8, $j + 1, 0, 0, 'C');
$pdf->MultiCell(95, 8, $description[$j], 0, 'L', 0, 0, '', '', true, 0, false, true, 8, 'M', true);
$pdf->Cell(15, 8, $itemqty[$j], 0, 0, 'C');
$pdf->Cell(30, 8, $price[$j], 0, 0, 'R');
$pdf->MultiCell(30, 8, $discount[$j], 0, '', 0, 0, '', '', true, 0, false, true, 8, 'M', true);
if ($pdf->getY() > $pdf->getPageHeight() - 56.5) {
$pdf->rollbackTransaction(true);
$pdf->AddPage();
$pdf->setY(100);
示例9:
/**
* Show top header of page.
*
* @param PDF $pdf Object PDF
* @param int $page Object to show
* @param int $showaddress 0=no, 1=yes
* @param Translate $outputlangs Object lang for output
* @return void
*/
function _pagehead(&$pdf, $page, $showaddress, $outputlangs)
{
global $langs;
// Do not add the BACKGROUND as this is a report
//pdf_pagehead($pdf,$outputlangs,$this->page_hauteur);
$default_font_size = pdf_getPDFFontSize($outputlangs);
$title = $outputlangs->transnoentities("ListOfCustomerPayments");
$title .= ' - ' . dol_print_date(dol_mktime(0, 0, 0, $this->month, 1, $this->year), "%B %Y", false, $outputlangs, true);
$pdf->SetFont('', 'B', $default_font_size + 1);
$pdf->SetXY($this->marge_gauche, 10);
$pdf->MultiCell($this->page_largeur - $this->marge_droite - $this->marge_gauche, 2, $title, 0, 'C');
$pdf->SetFont('', '', $default_font_size);
$pdf->SetXY($this->posxdate, 16);
$pdf->MultiCell(80, 2, $outputlangs->transnoentities("DateBuild") . " : " . dol_print_date(time(), "day", false, $outputlangs, true), 0, 'L');
$pdf->SetXY($this->posxdate, 22);
$pdf->MultiCell(80, 2, $outputlangs->transnoentities("Page") . " : " . $page, 0, 'L');
// Title line
$pdf->SetXY($this->posxdate, $this->tab_top + 2);
$pdf->MultiCell($this->posxpaymenttype - $this->posxdate, 2, 'Date');
$pdf->line($this->posxpaymenttype - 1, $this->tab_top, $this->posxpaymenttype - 1, $this->tab_top + $this->tab_height + 10);
$pdf->SetXY($this->posxpaymenttype, $this->tab_top + 2);
$pdf->MultiCell($this->posxinvoice - $this->posxpaymenttype, 2, $outputlangs->transnoentities("PaymentMode"), 0, 'L');
$pdf->line($this->posxinvoice - 1, $this->tab_top, $this->posxinvoice - 1, $this->tab_top + $this->tab_height + 10);
$pdf->SetXY($this->posxinvoice, $this->tab_top + 2);
$pdf->MultiCell($this->posxinvoiceamount - $this->posxinvoice, 2, $outputlangs->transnoentities("Invoice"), 0, 'L');
$pdf->line($this->posxinvoiceamount - 1, $this->tab_top, $this->posxinvoiceamount - 1, $this->tab_top + $this->tab_height + 10);
$pdf->SetXY($this->posxinvoiceamount, $this->tab_top + 2);
$pdf->MultiCell($this->posxpaymentamount - $this->posxinvoiceamount - 1, 2, $outputlangs->transnoentities("AmountInvoice"), 0, 'R');
$pdf->line($this->posxpaymentamount - 1, $this->tab_top, $this->posxpaymentamount - 1, $this->tab_top + $this->tab_height + 10);
$pdf->SetXY($this->posxpaymentamount, $this->tab_top + 2);
$pdf->MultiCell($this->page_largeur - $this->marge_droite - $this->posxpaymentamount - 1, 2, $outputlangs->transnoentities("AmountPayment"), 0, 'R');
$pdf->line($this->marge_gauche, $this->tab_top + 10, $this->page_largeur - $this->marge_droite, $this->tab_top + 10);
$pdf->Rect($this->marge_gauche, $this->tab_top, $this->page_largeur - $this->marge_gauche - $this->marge_droite, $this->tab_height + 10);
}
示例10:
/**
* Show footer of page. Need this->emetteur object
*
* @param PDF $pdf PDF
* @param Object $object Object to show
* @param Translate $outputlangs Object lang for output
* @param int $hidefreetext 1=Hide free text
* @return void
*/
function _pagefoot(&$pdf, $object, $outputlangs, $hidefreetext = 0)
{
global $conf;
$default_font_size = pdf_getPDFFontSize($outputlangs);
//return pdf_pagefoot($pdf,$outputlangs,'BANK_CHEQUERECEIPT_FREE_TEXT',$this->emetteur,$this->marge_basse,$this->marge_gauche,$this->page_hauteur,$object);
$paramfreetext = 'BANK_CHEQUERECEIPT_FREE_TEXT';
$marge_basse = $this->marge_basse;
$marge_gauche = $this->marge_gauche;
$page_hauteur = $this->page_hauteur;
// Line of free text
$line = !empty($conf->global->{$paramfreetext}) ? $outputlangs->convToOutputCharset($conf->global->{$paramfreetext}) : "";
$pdf->SetFont('', '', $default_font_size - 3);
$pdf->SetDrawColor(224, 224, 224);
// On positionne le debut du bas de page selon nbre de lignes de ce bas de page
$nbofline = dol_nboflines_bis($line, 0, $outputlangs->charset_output);
//print 'e'.$line.'t'.dol_nboflines($line);exit;
$posy = $marge_basse + $nbofline * 3;
if ($line) {
$pdf->SetXY($marge_gauche, -$posy);
$pdf->MultiCell(20000, 3, $line, 0, 'L', 0);
// Use a large value 20000, to not have automatic wrap. This make user understand, he need to add CR on its text.
$posy -= $nbofline * 3;
// 6 of ligne + 3 of MultiCell
}
$pdf->SetY(-$posy);
$pdf->line($marge_gauche, $page_hauteur - $posy, 200, $page_hauteur - $posy);
$posy--;
/*if ($line1)
{
$pdf->SetXY($marge_gauche,-$posy);
$pdf->MultiCell(200, 2, $line1, 0, 'C', 0);
}
if ($line2)
{
$posy-=3;
$pdf->SetXY($marge_gauche,-$posy);
$pdf->MultiCell(200, 2, $line2, 0, 'C', 0);
}*/
// Show page nb only on iso languages (so default Helvetica font)
if (pdf_getPDFFont($outputlangs) == 'Helvetica') {
$pdf->SetXY(-20, -$posy);
$pdf->MultiCell(11, 2, $pdf->PageNo() . '/' . $pdf->getAliasNbPages(), 0, 'R', 0);
}
}
示例11: printRect
/**
* Rect pdf
*
* @param PDF $pdf Object PDF
* @param float $x Abscissa of first point
* @param float $y Ordinate of first point
* @param float $l ??
* @param float $h ??
* @param int $hidetop 1=Hide top bar of array and title, 0=Hide nothing, -1=Hide only title
* @param int $hidebottom Hide bottom
* @return void
*/
function printRect($pdf, $x, $y, $l, $h, $hidetop = 0, $hidebottom = 0)
{
if (empty($hidetop) || $hidetop == -1) {
$pdf->line($x, $y, $x + $l, $y);
}
$pdf->line($x + $l, $y, $x + $l, $y + $h);
if (empty($hidebottom)) {
$pdf->line($x + $l, $y + $h, $x, $y + $h);
}
$pdf->line($x, $y + $h, $x, $y);
}
示例12: substr
$str = substr($str, $prev);
// [X]
$y1 = $pdf->GetY();
$x1 = $pdf->GetX() + $pdf->lMargin;
$y2 = $y1 + 4;
$x2 = $pdf->lMargin - 2;
while ($indent != "") {
// $y1=$y1+$vspacing;
$x1 = $pdf->GetX();
// $y2=$y1+6;
$x2 = $x1 + 1;
$ind = substr($indent, 0, 1);
$indent = substr($indent, 1);
switch ($ind) {
case "I":
$pdf->line($x1, $y1 + $vspacing, $x1, $y2 + $vspacing);
$pdf->SetXY($x2, $y1 + 1 + $vspacing);
break;
case "T":
// T
$pdf->line($x1, $y1 + $vspacing, $x1, $y2 + $vspacing);
// "|"
$pdf->line($x1, $y2 - 1 + $vspacing, $x2, $y2 - 1 + $vspacing);
// "-"
$pdf->SetXY($x2, $y2 + $vspacing);
break;
case "L":
// L
$pdf->line($x1, $y1 + $vspacing, $x1, $y2 - 1 + $vspacing);
// |
$pdf->line($x1, $y2 - 1 + $vspacing, $x2, $y2 - 1 + $vspacing);
示例13: PDF
}
$pdf = new PDF("P", "mm", "a5");
$pdf->AddPage();
$pdf->SetFont('Arial', '', 10);
//Table with 20 rows and 4 columns
$pdf->SetWidths(array(24, 90, 16, 40));
srand(microtime() * 1000000);
$subtotal = 0;
for ($i = 0; $i < count($_SESSION["basket"]); $i++) {
$quantity = $_SESSION["basket"][$i]["quantity"];
$price = $_SESSION["basket"][$i]["Item"]->Price;
$pdf->Row(array($quantity . "x", $_SESSION["basket"][$i]["Item"]->Name . ": " . $_SESSION["basket"][$i]["Item"]->Description, $price * $quantity));
$subtotal += $price * $quantity;
}
$pdf->SetFont('Arial', 'B', 12);
$pdf->MultiCell(130, 10, " Subtotal " . iconv("UTF-8", "ISO-8859-1", "£") . $subtotal, 0, "R");
$pdf->SetFont('Arial', '', 10);
$pdf->line(10, $pdf->GetY(), 140, $pdf->GetY());
$pdf->MultiCell(130, 5, "Note: Please make sure my food is not spicy!", 0, "L");
$pdf->Ln();
$pdf->MultiCell(60, 5, "Customer Info:", 0, "L");
$pdf->MultiCell(60, 5, "Saber Hamidi", 0, "L");
$pdf->MultiCell(60, 5, "100 Ourwebsite Road", 0, "L");
$pdf->MultiCell(60, 5, "Southampton", 0, "L");
$pdf->MultiCell(60, 5, "SO15 3FF", 0, "L");
$pdf->Ln();
$pdf->MultiCell(60, 5, "Tell: 07788998764", 0, "L");
$pdf->Ln();
$pdf->MultiCell(80, 5, "Paying upon Delivery - (The order is NOT PAID!)", 0, "L");
$filename = "Orders/test.pdf";
$pdf->Output();
示例14: pdf_pagefoot
/**
* Show footer of page for PDF generation
*
* @param PDF $pdf The PDF factory
* @param Translate $outputlangs Object lang for output
* @param string $paramfreetext Constant name of free text
* @param Societe $fromcompany Object company
* @param int $marge_basse Margin bottom we use for the autobreak
* @param int $marge_gauche Margin left (no more used)
* @param int $page_hauteur Page height (no more used)
* @param Object $object Object shown in PDF
* @param int $showdetails Show company details into footer. This param seems to not be used by standard version. (1=Show address, 2=Show managers, 3=Both)
* @param int $hidefreetext 1=Hide free text, 0=Show free text
* @return int Return height of bottom margin including footer text
*/
function pdf_pagefoot(&$pdf, $outputlangs, $paramfreetext, $fromcompany, $marge_basse, $marge_gauche, $page_hauteur, $object, $showdetails = 0, $hidefreetext = 0)
{
global $conf, $user;
$outputlangs->load("dict");
$line = '';
$dims = $pdf->getPageDimensions();
// Line of free text
if (empty($hidefreetext) && !empty($conf->global->{$paramfreetext})) {
// Make substitution
$substitutionarray = array('__FROM_NAME__' => $fromcompany->name, '__FROM_EMAIL__' => $fromcompany->email, '__TOTAL_TTC__' => $object->total_ttc, '__TOTAL_HT__' => $object->total_ht, '__TOTAL_VAT__' => $object->total_vat);
complete_substitutions_array($substitutionarray, $outputlangs, $object);
$newfreetext = make_substitutions($conf->global->{$paramfreetext}, $substitutionarray);
$line .= $outputlangs->convToOutputCharset($newfreetext);
}
// First line of company infos
$line1 = "";
$line2 = "";
$line3 = "";
$line4 = "";
if ($showdetails) {
// Company name
if ($fromcompany->name) {
$line1 .= ($line1 ? " - " : "") . $outputlangs->transnoentities("RegisteredOffice") . ": " . $fromcompany->name;
}
// Address
if ($fromcompany->address) {
$line1 .= ($line1 ? " - " : "") . $fromcompany->address;
}
// Zip code
if ($fromcompany->zip) {
$line1 .= ($line1 ? " - " : "") . $fromcompany->zip;
}
// Town
if ($fromcompany->town) {
$line1 .= ($line1 ? " " : "") . $fromcompany->town;
}
// Phone
if ($fromcompany->phone) {
$line1 .= ($line1 ? " - " : "") . $outputlangs->transnoentities("Phone") . ": " . $fromcompany->phone;
}
// Fax
if ($fromcompany->fax) {
$line1 .= ($line1 ? " - " : "") . $outputlangs->transnoentities("Fax") . ": " . $fromcompany->fax;
}
// URL
if ($fromcompany->url) {
$line2 .= ($line2 ? " - " : "") . $fromcompany->url;
}
// Email
if ($fromcompany->email) {
$line2 .= ($line2 ? " - " : "") . $fromcompany->email;
}
}
if ($showdetails || $fromcompany->country_code == 'DE') {
// Managers
if ($fromcompany->managers) {
$line2 .= ($line2 ? " - " : "") . $fromcompany->managers;
}
}
// Line 3 of company infos
// Juridical status
if ($fromcompany->forme_juridique_code) {
$line3 .= ($line3 ? " - " : "") . $outputlangs->convToOutputCharset(getFormeJuridiqueLabel($fromcompany->forme_juridique_code));
}
// Capital
if ($fromcompany->capital) {
$tmpamounttoshow = price2num($fromcompany->capital);
// This field is a free string
if (is_numeric($tmpamounttoshow) && $tmpamounttoshow > 0) {
$line3 .= ($line3 ? " - " : "") . $outputlangs->transnoentities("CapitalOf", price($tmpamounttoshow, 0, $outputlangs, 0, 0, 0, $conf->currency));
} else {
$line3 .= ($line3 ? " - " : "") . $outputlangs->transnoentities("CapitalOf", $tmpamounttoshow, $outputlangs);
}
}
// Prof Id 1
if ($fromcompany->idprof1 && ($fromcompany->country_code != 'FR' || !$fromcompany->idprof2)) {
$field = $outputlangs->transcountrynoentities("ProfId1", $fromcompany->country_code);
if (preg_match('/\\((.*)\\)/i', $field, $reg)) {
$field = $reg[1];
}
$line3 .= ($line3 ? " - " : "") . $field . ": " . $outputlangs->convToOutputCharset($fromcompany->idprof1);
}
// Prof Id 2
if ($fromcompany->idprof2) {
$field = $outputlangs->transcountrynoentities("ProfId2", $fromcompany->country_code);
//.........这里部分代码省略.........
示例15:
/**
* Show table for lines
*
* @param PDF $pdf Object PDF
* @param string $tab_top Top position of table
* @param string $tab_height Height of table (rectangle)
* @param int $nexY Y
* @param Translate $outputlangs Langs object
* @param int $hidetop Hide top bar of array
* @param int $hidebottom Hide bottom bar of array
* @return void
*/
function _tableau(&$pdf, $tab_top, $tab_height, $nexY, $outputlangs, $hidetop = 0, $hidebottom = 0)
{
global $conf, $mysoc;
$default_font_size = pdf_getPDFFontSize($outputlangs);
$pdf->SetDrawColor(128, 128, 128);
// Rect prend une longueur en 3eme param
$pdf->Rect($this->marge_gauche, $tab_top, $this->page_largeur - $this->marge_gauche - $this->marge_droite, $tab_height);
// line prend une position y en 3eme param
$pdf->line($this->marge_gauche, $tab_top + 6, $this->page_largeur - $this->marge_droite, $tab_top + 6);
$pdf->SetTextColor(0, 0, 0);
$pdf->SetFont('', '', $default_font_size);
$pdf->SetXY($this->posxref - 1, $tab_top + 2);
$pdf->MultiCell(80, 2, $outputlangs->transnoentities("Tasks"), '', 'L');
}