Пример #1
2
/**
 *	Show linked objects for PDF generation
 *
 *	@param	PDF			$pdf				Object PDF
 *	@param	object		$object				Object
 *	@param  Translate	$outputlangs		Object lang
 *	@param  int			$posx				X
 *	@param  int			$posy				Y
 *	@param	float		$w					Width of cells. If 0, they extend up to the right margin of the page.
 *	@param	float		$h					Cell minimum height. The cell extends automatically if needed.
 *	@param	int			$align				Align
 *	@param	string		$default_font_size	Font size
 *	@return	float                           The Y PDF position
 */
function pdf_writeLinkedObjects(&$pdf, $object, $outputlangs, $posx, $posy, $w, $h, $align, $default_font_size)
{
    $linkedobjects = pdf_getLinkedObjects($object, $outputlangs);
    if (!empty($linkedobjects)) {
        foreach ($linkedobjects as $linkedobject) {
            $posy += 3;
            $pdf->SetXY($posx, $posy);
            $pdf->SetFont('', '', $default_font_size - 2);
            $pdf->MultiCell($w, $h, $linkedobject["ref_title"] . ' : ' . $linkedobject["ref_value"], '', $align);
            if (!empty($linkedobject["date_title"]) && !empty($linkedobject["date_value"])) {
                $posy += 3;
                $pdf->SetXY($posx, $posy);
                $pdf->MultiCell($w, $h, $linkedobject["date_title"] . ' : ' . $linkedobject["date_value"], '', $align);
            }
        }
    }
    return $pdf->getY();
}
Пример #2
0
 $pdf->Cell(50, 8, "Remarks", 0, 0, 'C');
 $pdf->line(0, 110, 220, 110);
 //line after slno, desc and remarks
 $pdf->ln(6);
 $j = 0;
 ///part count
 $l = 0;
 ///challan counter
 $k = 1;
 // for serial no
 $r = 1;
 //1 means ok to outpit serial no
 $pdf->ln(8);
 while ($j < count($dq_list)) {
     if ($dq_list[$j][0] != '') {
         if ($pdf->getY() > $pdf->getPageHeight() - 75) {
             $pdf->rollbackTransaction(true);
             $pdf->AddPage();
             $pdf->setY(56);
             $r = 1;
         }
         $pdf->SetFont('helvetica', '', 10);
         //body font
         if ($r) {
             $pdf->Cell(20, 8, $k, 0, 0, 'C');
             ///print serial no
         } else {
             $pdf->Cell(20, 8, '', 0, 0, 'C');
             //no serial no
         }
         $part = new Part();
Пример #3
0
 $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);
         }
     }
     $j++;
 }
 if ($notes != '') {
     $pdf->ln(12);
     $pdf->MultiCell(195, 8, 'Note:' . $notes, 0, 'L', 0, 0, '', '', true, 0, false, true, 8, 'L', true);
 }
 $db = Database::getInstance();
 $cxn = $db->getConnection();
 if (isset($potermid)) {
     $potermid = array_values($potermid);
Пример #4
0
        $pdf->Cell(15, $margin, date("d-m-Y", strtotime($outbox->tgl_masuk)), 0, 0);
        $pdf->Cell(15, $margin, date("d-m-Y", strtotime($outbox->tgl_surat)), 0, 0);
        $current_x1 = $pdf->GetX();
        $current_y1 = $pdf->GetY();
        $pdf->Cell(90);
        $current_x2 = $pdf->GetX();
        $current_y2 = $pdf->GetY();
        $pdf->Cell(50);
        $current_x3 = $pdf->GetX();
        $current_y3 = $pdf->GetY();
        $pdf->Cell(35);
        $pdf->Cell(30, $margin, $outbox->nama_jenis, 0, 0);
        $pdf->Cell(0, $margin, $outbox->first_name, 0, 0);
        $pdf->SetXY($current_x3, $current_y3);
        $pdf->MultiCell(35, $margin, $outbox->ptt, 0, 'L');
        $y3 = $pdf->getY();
        $pdf->SetXY($current_x2, $current_y2);
        $pdf->MultiCell(50, $margin, $outbox->tujuan, 0, 'L');
        $y2 = $pdf->getY();
        $pdf->SetXY($current_x1, $current_y1);
        $pdf->MultiCell(90, $margin, $outbox->perihal, 0, 'L');
        $y1 = $pdf->getY();
        $pdf->setY(max($y1, $y2, $y3));
        $pdf->CreateLine($pdf->GetY());
        if ($outbox == end($data_outbox)) {
            $pdf->CountJenis($i);
        }
    }
}
$nama_file = get_user_name() . '_' . date(now());
$pdf->Output($nama_file, 'I');
Пример #5
0
<?php

// CREAR PDF
$pdf = new PDF('Landscape', 'mm', 'Letter', $header);
$pdf->AliasNbPages();
$pdf->AddPage();
$fs = 8;
$lh = 8;
$pdf->SetFont('Arial', '', $fs);
$pdf->SetFillColor(255, 255, 255);
$pdf->SetDrawColor(0, 0, 0);
$pdf->Ln(2);
$y = $pdf->getY();
$x = $pdf->getX();
$pdf->Celda(256, 160, '', 1, 1, '', true);
$y2 = $pdf->getY();
$pdf->setY($y + 1);
$pdf->setX($x + 1);
$pdf->Celda(20, 5, 'Estado: ', 0, 0, '', true);
$pdf->Celda(100, 5, $pdf->capitalizar($header['estado']), 'B', 0, '', true);
$pdf->Celda(20, 5, 'Municipio: ', 0, 0, '', true);
$pdf->Celda(110, 5, $pdf->capitalizar($header['municipio']), 'B', 1, '', true);
$y = $pdf->getY();
$pdf->setY($y + 1);
$pdf->setX($x + 1);
$pdf->Celda(50, 5, 'Unidad de Trabajo o Dependencia: ', 0, 0, '', true);
$pdf->Celda(200, 5, $pdf->capitalizar($header['dependencia']), 'B', 1, '', true);
$yt = $pdf->getY();
$pdf->setX($yt + 1);
$pdf->setX($x + 1);
$lh2 = 5;
Пример #6
0
//
//
//$text = iconv("iso-8859-1", "iso-8859-2", $SUMNIKI);
//test Šumnikov
///koliko bomo pomaknili vse v desno//
$XOF = 26;
$LN_DEFAULT = 5;
//Instanciation of inherited class
$pdf = new PDF();
$pdf->AliasNbPages();
$pdf->AddPage();
$pdf->Image('img/obrazec.jpg', 0, 0, 197, 297);
//$pdf->AddFont('luxisb','','luxisb.php');
$pdf->AddFont('Arial', '', 'Arial.php');
$pdf->SetFont('Arial', '', 8);
//Cell(float w [, float h [, string txt [, mixed border [, int ln [, string align [, boolean fill [, mixed link]]]]]]])
//NAziv in sedez
$pdf->SetXY($XOF + 35, 15);
$pdf->Cell(0, 0, "Root d.o.o., cesta v {$text} 10 3320 velenje", 0, 0, 'L');
//$pdf->MultiCell(65, 4,'sss', '', 'TL',0);
$pdf->Ln($LN_DEFAULT);
$pdf->SetXY($XOF + 13, $pdf->getY());
//napisemo davcno//
$pdf->Cell(0, 0, spacer("123456789123", 4, 3), 0, 0, 'L');
//nova vrsta
$pdf->Ln($LN_DEFAULT);
$pdf->SetXY($XOF + 30, $pdf->getY());
//gospodarska dejavnost//
$pdf->Cell(0, 0, 'Struzenje in gledanje', 0, 0, 'L');
//output of the PDF//
$pdf->Output("test.pdf", "I");
Пример #7
0
            $pdf->Cell(15, 4, 'X', 1, 0, '');
        } else {
            $pdf->Cell(15, 4, '', 1, 0, '');
        }
        $pdf->SetDrawColor(235, 235, 235);
        $pdf->Cell(25, 4, '', 1, 0, '');
        $pdf->SetDrawColor(0, 0, 0);
        $pdf->Cell(60, 4, $data['CODEACTIVITE'] . ' ' . $data['LibelleActivite'], 1, 1, '');
    }
}
$pdf->SetY($pdf->GetY() - $i * 4);
$pdf->SetX(130);
$Y = $pdf->GetY();
$pdf->Cell(20, 4 * $i, '', 1, 0, '');
$pdf->RotatedText(140, $Y + 2, $processus, -90);
$pdf->SetY($pdf->getY() + $i * 4);
$i = 0;
foreach ($rows as $data) {
    if ($data['CODEPROCESSUS'] == 'P2') {
        $processus = $data['LibelleProcessus'];
        $i = $i + 1;
        $pdf->SetX(30);
        $ref = false;
        foreach ($rowsRef as $data1) {
            if ($data['CODEACTIVITE'] == $data1['codeactivite'] and $data1['nbRef'] > 0) {
                $ref = true;
            }
        }
        if ($ref) {
            $pdf->Cell(15, 4, 'X', 1, 0, '');
        } else {
Пример #8
0
$s = "čšžčk";
//$s is a string from whatever source
//mb_detect_encoding($s, "UTF-8") == "UTF-8" ? : $s = utf8_encode($s);
//$s = iconv("UTF-8//TRANSLIT", "iso-8859-2", $s);
utf8_encode($s);
///koliko bomo pomaknili vse v desno//
$XOF = 26;
$LN_DEFAULT = 4;
//Instanciation of inherited class
$pdf = new PDF();
$pdf->AliasNbPages();
$pdf->AddPage();
//$pdf->AddFont('luxisb','','luxisb.php');
$pdf->AddFont('Arial', '', 'Arial.php');
$pdf->SetFont('Arial', '', 8);
//Cell(float w [, float h [, string txt [, mixed border [, int ln [, string align [, boolean fill [, mixed link]]]]]]])
//NAziv in sedez
$pdf->SetXY($XOF + 35, 29);
$pdf->Cell(0, 0, "Root d.o.o., cesta v {$s} 10 3320 velenje", 0, 0, 'L');
//$pdf->MultiCell(65, 4,'sss', '', 'TL',0);
$pdf->Ln($LN_DEFAULT);
$pdf->SetXY($XOF + 22, $pdf->getY());
//napisemo davcno//
$pdf->Cell(0, 0, spacer("2005977500396", 4), 0, 0, 'L');
//nova vrsta
$pdf->Ln($LN_DEFAULT);
$pdf->SetXY($XOF + 30, $pdf->getY());
//gospodarska dejavnost//
$pdf->Cell(0, 0, 'Struzenje in gledanje', 0, 0, 'L');
//output of the PDF//
$pdf->Output("test.pdf", "I");
Пример #9
0
        }
    }
}
$filter = whereMaker($filter, 'requestor', $requestor_id);
$filter = whereMaker($filter, 'company_name', $company_name);
$filter = whereMaker($filter, 'supplier', $supplier_id);
$filter = whereMaker($filter, 'secretary', $secretary_id);
$SELECT_po = "select * from po_file" . $filter;
$head = array("Date", "Letter", "Mode of Payment", "Company Name", "Engineer", "Secretary", "PO#", "JO#", "Item Description", "Page#", "Pay to", "Total amount", "Particulars");
//,"RM /ANY Time of Text",
// "Time Replied to RM / ANY","Time CR text","Time Reply to CR",
//"Time forward to Boss","Time Approved by Boss"
$result = $conn->query($SELECT_po);
$width = array(32, 14, 30, 30, 25, 25, 14, 14, 40, 15, 25, 23, 45, 45);
$pdf->AddPage();
$y = $pdf->getY();
//echo "<br>".$pdf->getY();
$pdf->Ln();
$pdf->Ln();
$pdf->Ln();
$pdf->Ln();
$pdf->setY($y + 22);
//	echo "<br>2".$pdf->getY();
$data2 = array();
$pdf->row($width, $head, 1, $data2, $data2);
while ($row = $result->fetch_assoc()) {
    if (empty($engineer[$row['engineer']])) {
        $engineer[$row['engineer']] = "";
    }
    if (empty($secretary[$row['secretary']])) {
        $secretary[$row['secretary']] = "";