本文整理汇总了PHP中FPDI::SetX方法的典型用法代码示例。如果您正苦于以下问题:PHP FPDI::SetX方法的具体用法?PHP FPDI::SetX怎么用?PHP FPDI::SetX使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类FPDI
的用法示例。
在下文中一共展示了FPDI::SetX方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: DBExecSql
$pdf->Text(105, 73, $rowCabecera["DESCRIPCION"]);
$pdf->Text(170, 73, $rowCabecera["MONTOREEMP"]);
//---------------------------------------------------------------------------
$i = 1;
$netoAPagar = 0;
$posX = 0;
$stmt = DBExecSql($conn, $sqlMain, $paramsMain);
while ($row = DBGetQuery($stmt, 1, false)) {
if ($i == 1 && $netoAPagar > 0) { $pdf->AddPage();}
$posX = (93 + ($i*4));
$pdf->SetXY(20, $posX);
$pdf->Cell(20, 0, $row["DESCRIPTION"], 0, 0, 'L' );
$pdf->SetX(40);
$pdf->Cell(50, 0, $row["BANK_NAME"], 0, 0, 'L' );
$pdf->SetX(88);
$pdf->Cell(20, 0, $row["BANK_ACCOUNT_NUM"], 0, 0, 'L' );
$pdf->SetX(120);
$pdf->Cell(20, 0, $row["CHEQUE"], 0, 0, 'L' );
$pdf->SetX(146);
$pdf->Cell(20, 0, $row["FECHA_OP"], 0, 0, 'L' );
$pdf->SetX(170);
$pdf->Cell(20, 0, $row["MONTO"], 0, 0, 'R' );
$i++;
示例2: executeBatchPrintBadge
public function executeBatchPrintBadge(sfWebRequest $request)
{
$ids = $request->getParameter('ids');
// initiate FPDI
$pdf = new FPDI('P', 'pt');
// set the sourcefile
$pdf->setSourceFile(sfConfig::get('sf_upload_dir') . '/badges/ID_new.pdf');
foreach ($ids as $id) {
$this->employee = EmployeePeer::retrieveByPk($id);
// import page 1
$tplIdx = $pdf->importPage(1);
// add a new page based on size of the badge
$s = $pdf->getTemplatesize($tplIdx);
$pdf->AddPage('P', array($s['w'], $s['h']));
$pdf->useTemplate($tplIdx);
$pdf->setMargins(0, 0, 0, 0);
$pdf->SetAutoPageBreak(false);
if ($this->employee->getPicture()) {
$pdf->Image(sfConfig::get('sf_upload_dir') . '/' . sfConfig::get('app_employee_images_dir') . '/' . $this->employee->getPicture(), 29.5, 25.5, 60.3, 74.3);
} else {
$pdf->Image(sfConfig::get('sf_upload_dir') . '/badges/picture_missing.jpg', 29.5, 25.5, 60.3, 74.3);
}
// now write some text above the imported page
$pdf->SetFont('freesans', 'B', 12);
$pdf->SetTextColor(82, 78, 134);
$pdf->SetXY(22, 110);
$pdf->Cell(0, 12, $this->employee->getFullName());
$pdf->Ln();
$pdf->SetX(22);
$pdf->SetFont('freesans', 'BI', 10);
$pdf->Cell(0, 14, $this->employee->getJob());
$pdf->SetDisplayMode('real');
}
return $pdf->Output('newpdf.pdf', 'D');
}
示例3: FPDI
function back_id($results)
{
$this->load->helper('settings');
//print preview of MR
$this->load->library('fpdf');
$this->load->library('fpdi');
// initiate FPDI
$pdf = new FPDI('L');
// add a page
$pdf->AddPage();
// set the sourcefile
$pagecount = $pdf->setSourceFile('pdf-report/id/back-id.pdf');
// import page 1
$tplIdx = $pdf->importPage(1);
// use the imported page and place it at point 10,10 with a width of 100 mm
$pdf->useTemplate($tplIdx);
// now write some text above the imported page
$pdf->SetTextColor(0, 0, 0);
$pdf->SetFont('Arial', '', 7);
$n = 1;
foreach ($results as $result) {
$s = new Personal_m();
$row = $s->get_by_employee_id($result->employee_id);
//======================== START Column 1 | Right to Left ==============================
if ($n == 11) {
//add new page
$pdf->addPage();
for ($n = 1; $n <= 1; $n++) {
$tplidx = $pdf->ImportPage(1);
$pdf->useTemplate($tplIdx);
//, 1, 1, 210
}
$n = $n - 1;
}
$bday = $row->birth_date;
$address = $row->res_address;
$blood_type = '"' . $row->blood_type . '"';
$gsis = $row->gsis;
$pagibig = $row->pagibig;
$philhealth = $row->philhealth;
$tin = $row->tin;
$emergency = '';
$contact = $row->cp;
//----------------------------- Row 1 ----------------------------------
///Birthday
if ($n == 1) {
//Birthday
if ($bday != '0000-00-00') {
$pdf->SetXY(247, 23);
$pdf->Cell(50, 0, date('F d, Y', strtotime(date('F d, Y', strtotime($bday)))), '0', 0, 'C', false);
}
//Address
$pdf->SetXY(257, 15);
$addr = splitstroverflow(ucwords(strtolower(utf8_decode($address))), 28);
$pdf->Cell(30, 0, $addr[0], '0', 0, 'C', false);
//display text overflow
if ($addr[1]) {
$pdf->Ln(2.5);
$pdf->SetX(257);
$pdf->Cell(30, 0, $addr[1], '0', 0, 'C', false);
}
if ($addr[2]) {
$pdf->Ln(2.5);
$pdf->SetX(257);
$pdf->Cell(30, 0, $addr[2], '0', 0, 'C', false);
}
if ($addr[3]) {
$pdf->Ln(2.5);
$pdf->SetX(257);
$pdf->Cell(30, 0, $addr[3], '0', 0, 'C', false);
}
//Blood Type
$pdf->SetXY(247, 28.3);
$pdf->Cell(50, 0, strtoupper($blood_type), '0', 0, 'C', false);
//GSIS
$pdf->SetXY(247, 33);
$pdf->Cell(50, 0, strtoupper($gsis), '0', 0, 'C', false);
//PAGIBIG
$pdf->SetXY(247, 38);
$pdf->Cell(50, 0, strtoupper($pagibig), '0', 0, 'C', false);
//PHILHEALTH
$pdf->SetXY(247, 43.5);
$pdf->Cell(50, 0, strtoupper($philhealth), '0', 0, 'C', false);
//PHILHEALTH
$pdf->SetXY(247, 48.5);
$pdf->Cell(50, 0, strtoupper($tin), '0', 0, 'C', false);
//in case of emergency
$pdf->SetXY(235, 75.5);
$pdf->Cell(60, 0, strtoupper($emergency), '0', 0, 'C', false);
//CP No.
$pdf->SetXY(250, 78);
$cpno = splitstroverflow($contact, 13);
$pdf->Cell(30, 0, $cpno[0], '0', 0, 'C', false);
if ($cpno[1]) {
$pdf->Ln(3);
$pdf->SetX(250);
$pdf->Cell(30, 0, $cpno[1], '0', 0, 'C', false);
}
}
//----------------------------- Row 2 ----------------------------------
//.........这里部分代码省略.........
示例4: array
function ten_tardiness_second($second_offenders = array())
{
$this->load->library('fpdf');
define('FPDF_FONTPATH', $this->config->item('fonts_path'));
$this->load->library('fpdi');
// initiate FPDI
$pdf = new FPDI('P', 'mm', 'Legal');
$pdf->SetLeftMargin(20);
$pdf->SetRightMargin(15);
// add a page
$pdf->AddPage();
// set the sourcefile
$pdf->setSourceFile('dtr/template/notice2nd.pdf');
// select the first page
$tplIdx = $pdf->importPage(1);
// use the page we imported
$pdf->useTemplate($tplIdx);
$offices = Input::get('offices');
$office_id = $offices[0];
$m1 = 'Jul';
$m2 = 'Aug';
$m3 = 'Sep';
$m4 = 'Oct';
$m5 = 'Nov';
$m6 = 'Dec';
$mo1 = '07';
$mo2 = '08';
$mo3 = '09';
$mo4 = '10';
$mo5 = '11';
$mo6 = '12';
$pdf->SetFont('Arial', '', '12');
$pdf->SetXY(155, 50);
$pdf->Write(0, date('F d, Y'));
$pdf->SetX(35);
$pdf->SetFont('Arial', 'B', '');
$pdf->Cell(0, 6, "HON. EDWARD S. HAGEDORN ", '', 1, 'L', FALSE);
$pdf->SetFont('Arial', '', '');
$pdf->SetX(35);
$pdf->Cell(0, 6, "City Mayor", '', 1, 'L', FALSE);
$pdf->SetX(35);
$pdf->Cell(0, 6, "Puerto Princesa City", '', 1, 'L', FALSE);
$pdf->Cell(0, 6, "", '', 1, 'C', FALSE);
$pdf->Cell(0, 6, "Thru: ATTY. SHIRLEY R. DAGANTA", '', 1, 'C', FALSE);
$pdf->Cell(0, 6, "CG Assistant Dept. Head II", '', 1, 'C', FALSE);
$pdf->Cell(0, 6, "Assistant City Legal Officer II", '', 1, 'C', FALSE);
$pdf->Ln(12);
$pdf->SetX(35);
$pdf->SetFont('Arial', 'B', '');
$pdf->Write(0, 'Madam:');
$pdf->SetFont('Arial', '', '');
$pdf->Ln(6);
$pdf->SetX(35);
$pdf->MultiCell(0, 6, " Please be informed that despite the first notice issued to him/her as per records in this office, it has been observed that the he/she has continuously incurred the following tardiness and undertime, viz:", 0, 'L', false);
//$pdf->SetX(35);
//$pdf->Cell(0,6," $number of your employees has incurred the following, viz:",'',0,'L',false);
$pdf->SetFont('Arial', 'BI', 10);
$pdf->Ln(2);
$pdf->SetFillColor(210, 210, 210);
//$pdf->SetX(20);
//header
$pdf->Cell(50, 8, "Name", 'RLTB', 0, 'C', 1);
$pdf->Cell(20, 4, $m1, '1', 0, 'C', 1);
$pdf->Cell(20, 4, $m2, '1', 0, 'C', 1);
$pdf->Cell(20, 4, $m3, '1', 0, 'C', 1);
$pdf->Cell(20, 4, $m4, '1', 0, 'C', 1);
$pdf->Cell(20, 4, $m5, '1', 0, 'C', 1);
$pdf->Cell(20, 4, $m6, '1', 1, 'C', 1);
$pdf->SetFont('Arial', '', 9);
$pdf->SetFillColor(240, 240, 240);
$pdf->Cell(50, 4, "", 'RLB', 0, 'C', false);
$pdf->Cell(10, 4, "Tardy", '1', 0, 'C', 1);
$pdf->Cell(10, 4, "UT", '1', 0, 'C', 1);
$pdf->Cell(10, 4, "Tardy", '1', 0, 'C', 1);
$pdf->Cell(10, 4, "UT", '1', 0, 'C', 1);
$pdf->Cell(10, 4, "Tardy", '1', 0, 'C', 1);
$pdf->Cell(10, 4, "UT", '1', 0, 'C', 1);
$pdf->Cell(10, 4, "Tardy", '1', 0, 'C', 1);
$pdf->Cell(10, 4, "UT", '1', 0, 'C', 1);
$pdf->Cell(10, 4, "Tardy", '1', 0, 'C', 1);
$pdf->Cell(10, 4, "UT", '1', 0, 'C', 1);
$pdf->Cell(10, 4, "Tardy", '1', 0, 'C', 1);
$pdf->Cell(10, 4, "UT", '1', 1, 'C', 1);
$pdf->SetFillColor(215, 255, 215);
$year1 = Input::get('year');
$tardis = $second_offenders;
if (is_array($tardis)) {
foreach ($tardis as $tardi) {
$name = $this->Employee->get_employee_info($tardi, $field = '');
$late1 = $this->Tardiness->count_late($name['employee_id'], $mo1, $year1, 1, 3);
$late2 = $this->Tardiness->count_late($name['employee_id'], $mo2, $year1, 1, 3);
$late3 = $this->Tardiness->count_late($name['employee_id'], $mo3, $year1, 1, 3);
$late4 = $this->Tardiness->count_late($name['employee_id'], $mo4, $year1, 1, 3);
$late5 = $this->Tardiness->count_late($name['employee_id'], $mo5, $year1, 1, 3);
$late6 = $this->Tardiness->count_late($name['employee_id'], $mo6, $year1, 1, 3);
$under_time1 = $this->Tardiness->count_late($name['employee_id'], $mo1, $year1, 2, 4);
$under_time2 = $this->Tardiness->count_late($name['employee_id'], $mo2, $year1, 2, 4);
$under_time3 = $this->Tardiness->count_late($name['employee_id'], $mo3, $year1, 2, 4);
$under_time4 = $this->Tardiness->count_late($name['employee_id'], $mo4, $year1, 2, 4);
$under_time5 = $this->Tardiness->count_late($name['employee_id'], $mo5, $year1, 2, 4);
//.........这里部分代码省略.........
示例5: preview
//.........这里部分代码省略.........
<td> </td>
<td align="center">' . $sr_certified_position . '</td>
</tr>
</table>
';
$this->load->library('MPDF52/mpdf');
//$this->mpdf->WriteHTML('<p>Hello There hahahaha</p>');
//$this->mpdf->Output('mpdf.pdf','I');
// LOAD a stylesheet
$stylesheet = file_get_contents(base_url() . 'css/mpdf/mpdfstyletables.css');
$this->mpdf->WriteHTML($stylesheet, 1);
// The parameter 1 tells that this is css/style only and no body/html/text
$this->mpdf->WriteHTML($html);
$this->mpdf->Output('dtr/template/pds/archives/pds_' . date('Y_m_d') . '.pdf', 'F');
return 'dtr/template/pds/archives/pds_' . date('Y_m_d') . '.pdf';
exit;
$this->load->helper('settings');
$this->load->library('fpdf');
//define('FPDF_FONTPATH',$this->config->item('fonts_path'));
$this->load->library('fpdi');
// initiate FPDI
$pdf = new FPDI('L', 'mm', 'Letter');
// add a page
$pdf->AddPage();
// set the sourcefile
//$pdf->setSourceFile('dtr/template/service_record/service_record.pdf');
// import page 1
//$tplIdx = $pdf->importPage(1);
// use the imported page and place it at point 10,10 with a width of 100 mm
//$pdf->useTemplate($tplIdx, 1, 1, 210);
// now write some text above the imported page
$pdf->SetFont('Arial');
$pdf->SetTextColor(0, 0, 0);
$pdf->SetXY(15, 60);
$pdf->SetFont('Arial', '', 16);
$pdf->Cell(0, 3, "Report Name", '', 1, 'C', false);
//$pdf->Ln(4);
//$e = new Employee_m();
//$e->get_by_employee_id( $employee_id );
$pdf->SetFont('Arial', '', 12);
//$pdf->Cell(0,8,"Employee No.:".$e->id ,'',1,'L',false);
//$pdf->Ln(2);
//$pdf->SetFont('Arial', '', 12);
//$pdf->Cell(0,8,"Employee Name:".$e->lname.', '.$e->fname.' '.$e->mname ,'',1,'L',false);
$pdf->Ln(4);
$pdf->Cell(0, 8, "Emp ID Name Sex Position/Designation Office Employment Status Salary Grade Eligibility Education Birth Day Address", '1', 1, 'L', false);
$pdf->Ln(4);
$i = 1;
$this->load->helper('text');
//$pdf->Cell(30,12, word_wrap('msayado maahhn ndhah ahhhehe so ano gagawin mo now', 10) ,'1',1,'L',false);
//$pdf->MultiCell(30,3,word_wrap("hello this is a sample nlong text with line break ", 15) ,'1',1,'L',false);
//$pdf->MultiCell(30,3,word_wrap("hello this is a sample nlong text with line break ", 15) ,'0',1,'L',false);
foreach ($rows as $row) {
$pdf->SetFont('Arial', '', 11);
$pdf->SetX(10);
//$pdf->Write(0, $row->id);
$pdf->Cell(15, 12, $row->id, '1', 0, 'L', false);
$pdf->SetX(29);
//$pdf->Write(0, $row->lname.', '.$row->fname.''.$row->mname);
$pdf->Cell(30, 12, word_wrap($row->lname . ', ' . $row->fname . '' . $row->mname, 10), '1', 1, 'L', false);
$pdf->SetFont('Arial', '', 8);
$pdf->SetX(62);
$pdf->Write(0, $row->sex);
$pdf->SetX(75);
//$pdf->Write(0, $row->company);
$pdf->Write(0, $row->position);
示例6: date
$pdf->Text($repstr[x], $repstr[y], utf8_decode($firma["street"]));
$pdf->Text($report[x], $report[y], $firma["zipcode"] . " " . utf8_decode($firma["city"]));
$pdf->Text($repphone[x], $repphone[y], $firma["phone"]);
$pdf->Text($repaid[x], $repaid[y], $_GET["aid"]);
$pdf->SetFont($repfont, '', $repsizeN);
$pdf->Text($repwvnr[x], $repwvnr[y], $masch['contractnumber']);
$pdf->Text($repkdnr[x], $repkdnr[y], $firma["customernumber"]);
$pdf->Text($repdate[x], $repdate[y], date("d.m.Y"));
$pdf->Text($repmasch[x], $repmasch[y], utf8_decode($masch["description"]));
$pdf->Text($repser[x], $repser[y], $masch["serialnumber"]);
$pdf->Text($repsort[x], $repsort[y], utf8_decode($masch["standort"]));
$pdf->Text($repcnt[x], $repcnt[y], $masch["counter"]);
$pdf->Text($repinsp[x], $repinsp[y], db2date($masch["inspdatum"]));
$pdf->Text($repkurz[x], $repkurz[y], utf8_decode($rep["cause"]));
$pdf->SetY($replang[x]);
$pdf->SetX($replang[y]);
$pdf->MultiCell(0, 6, utf8_decode($rep["schaden"]), 0);
$pdf->addPage();
$history = "Die letzten Ereignisse:\n";
$history .= db2date($hist[0]["datum"]);
$history .= " " . $hist[0]["art"] . " ";
if ($hist[0]["art"] == "RepAuftr") {
preg_match("/^[0-9]+\\|(.+)/", utf8_decode($hist[0]["beschreibung"]), $treffer);
$history .= $treffer[1] . "\n";
} else {
$history .= $hist[0]["beschreibung"] . "\n";
}
$history .= db2date($hist[1]["datum"]);
$history .= " " . $hist[1]["art"] . " ";
if ($hist[1]["art"] == "RepAuftr") {
preg_match("/^[0-9]+\\|(.+)/", utf8_decode($hist[1]["beschreibung"]), $treffer);
示例7: sprintf
$hdl = $pdf->ImportPage(1);
$pdf->addPage();
$pdf->useTemplate($hdl);
$pdf->SetFont($wvfont, '', $wvsize);
$pdf->Text($wvname[x], $wvname[y], utf8_decode($firma["name"]));
$pdf->Text($wvstr[x], $wvstr[y], utf8_decode($firma["street"]));
$pdf->Text($wvort[x], $wvort[y], $firma["zipcode"] . " " . utf8_decode($firma["city"]));
$pdf->Text($wvkdnr[x], $wvkdnr[y], $firma["customernumber"]);
$pdf->Text($wvwvnr[x], $wvwvnr[y], $rep['contractnumber']);
$pdf->Text($wvstart[x], $wvstart[y], db2date($rep["anfangdatum"]));
$pdf->Text($wvende[x], $wvende[y], $ende);
$pdf->Text($wvbetrag[x], $wvbetrag[y], sprintf("%0.2f", $rep["betrag"]));
$pdf->SetFont('Helvetica', '', 10);
$bem = $rep["bemerkung"] ? utf8_decode($rep["bemerkung"]) : "Es werden keine Sondervereinbarungen getroffen";
$pdf->SetY($wvbem[y]);
$pdf->SetX($wvbem[x]);
$pdf->MultiCell(0, 6, $bem, 0);
for ($j = 2; $j <= $seiten; $j++) {
$hdl = @$pdf->ImportPage($j);
$pdf->addPage();
$pdf->useTemplate($hdl);
}
$pdf->SetFont($wvfont, '', $wvsize);
$i = 300;
$p = 1;
foreach ($masch as $row) {
if ($i > 270) {
$pdf->addPage();
$pdf->Text($wvkopf[x], $wvkopf[y], "Anhang A (Seite {$p}) zum Wartungsvertrag " . $rep['contractnumber'] . " vom " . db2date($rep["anfangdatum"]));
$i = 40;
$p++;
示例8: generatepdfAction
public function generatepdfAction(command $commande)
{
$request = $this->get('request');
$tools = $this->get('tools.utils');
$session = $request->getSession();
if ($session->has('tpl')) {
$tpl = $commande->getToprint();
$pdffile = "";
foreach ($tpl as $key => $elemnt) {
foreach ($elemnt as $val) {
$prod = $this->getDoctrine()->getRepository('MainFrontBundle:paramtpl')->find($val['id']);
$template = $prod->getTpl();
$tplpdf = str_replace("../", "", $template->getPdf());
$pdffile = $this->get('kernel')->getRootDir() . '/../web/' . $tplpdf;
}
}
$custom_layout = array(85, 55);
$orientation = 'L';
$pdf = new \FPDI($orientation, 'mm', $custom_layout, true, 'UTF-8', false);
$pdf->setPageOrientation($orientation);
$pdf->SetMargins(0, 0, 0);
$pdf->SetAutoPageBreak(true, 0);
$pdf->setFontSubsetting(false);
$pdf->AddPage($orientation);
// echo "<pre>";print_r($pdf->getMargins());exit;
$pdf->setSourceFile($pdffile);
$_tplIdx = $pdf->importPage(1);
$size = $pdf->useTemplate($_tplIdx, 0, 0, 85, 55, true);
$idd = "";
$i = 0;
$oldx = 0;
$oldy = 0;
foreach ($elemnt as $value) {
//if($i==0)
if ($idd != $value['id'] && $value['value'] != "") {
$pdf->SetPageMark();
if (substr($value['value'], 0, 4) != "/tmp") {
//$tools->dump($value);
$align = strtoupper(substr($value['align'], 0, 1));
$color = $this->hex2rgb($value['color']);
$pdf->SetTextColor($color[0], $color[1], $color[2]);
$param = $this->getDoctrine()->getRepository('MainFrontBundle:paramtpl')->find($value['id']);
$y2 = $param->getX1() / 5;
$x1 = $param->getY1() / 5;
//$x1 = 10;$y2 = 8;
$w = $param->getX2() / 5;
$h = $param->getY2() / 5;
$oldx = $x1;
$oldy = $y2;
$pdf->SetX($x1, false);
$pdf->SetY($y2, false);
//$pdf->SetXY($x1, $y2,true);
$pdf->SetFont(null, '', $param->getSize() * 0.6);
//$param->getPolice()
// echo $opt->getFontsize()."\n";
$pdf->Cell($w, $h, $value["value"], 0, 0, $align);
} else {
$param = $this->getDoctrine()->getRepository('MainFrontBundle:paramtpl')->find($value['id']);
$img = $this->getParameter('base_url') . $value['value'];
$pdf->Image($img, $param->getX1() / 4.5, $param->getY1() / 4.55, $param->getX2() / 4.55, $param->getY2() / 4.5, '', '', '', true);
}
}
$idd = $value['id'];
$i++;
}
//$pdf->Cell(0, $size['h'], 'TCPDF and FPDI');
// echo $template->getId();
$pdf->Output($this->get('kernel')->getRootDir() . '/../web/pdf.pdf');
}
return new Response("");
}
示例9: explode
$pdf->Cell(120, 0, $row2["PR_MAIL"]);
// Muestro el texto de arriba de las firmas..
$pdf->SetFont("Arial", "", 9);
$pdf->Ln(4);
$texto = explode("\n", "Por medio de la presente ".$row2["RAZON_SOCIAL"]." autoriza a Provincia ART S.A. a entregar a Provincia Seguros S.A. la información sobre la nómina (datos de Empleados, Masa Salarial, C.U.I.L., Nombre, etc.) e información complementaria que a criterio de la aseguradora permita tener un conocimiento de la actividad y del comportamiento del riesgo inherente a la cobertura.");
for ($i=0; $i<count($texto); $i++) {
$str = trim($texto[$i]);
$pdf->WordWrap($str, 188);
$pdf->Write(4, $str);
$pdf->Ln(2);
}
$pdf->SetX(8);
$pdf->SetY(250);
$pdf->Cell(120, 0, "Buenos Aires, ".date("d")." de ".GetMonthName(date("m"))." de ".date("Y"));
updateFechaImpresion((isset($idFormulario)?$idFormulario:0));
}
else {
$pdf->AddPage();
$pdf->SetTextColor(255, 0, 0);
$pdf->SetFont("Arial", "B", 14);
$pdf->Ln(30);
$pdf->Cell(0, 0, $msgSqlVacio, 0, 0, "C");
}
if ($autoPrint)
示例10:
// select the first page
$tplIdx = $pdf->importPage(1);
// use the page we imported
$pdf->useTemplate($tplIdx);
//====================================================================
// Write to the document
//====================================================================
// set font, font style, font size.
$pdf->SetFont('Arial', '', 6);
$pdf->SetTextColor(0, 51, 102);
// set initial placement
$pdf->SetXY(27, 15);
// line break
//$pdf->Ln(5);
// go to 25 X (indent)
$pdf->SetX(27);
// write
$pdf->SetFont('Arial', '', 10);
$pdf->Write(0, utf8_decode($ObtenerCabeceraFacturacion[0]['nombreCliente']));
// move to next line
$pdf->Ln(5);
$pdf->SetFont('Arial', '', 7);
// The following section is basically a repetition of the previous for inserting more text.
// repeat for more text:
$pdf->SetX(27);
$pdf->Write(0, $ObtenerCabeceraFacturacion[0]['DocumentoIdentidad']);
$pdf->Ln(4);
$pdf->SetX(27);
$pdf->Write(0, utf8_decode(ucwords(strtolower($ObtenerCabeceraFacturacion[0]['direccionCliente']))));
$pdf->Ln(4);
$pdf->SetX(27);
示例11: preview
function preview($employee_id)
{
$this->load->helper('settings');
$this->load->library('fpdf');
//define('FPDF_FONTPATH',$this->config->item('fonts_path'));
$this->load->library('fpdi');
//$pi = new Personal();
//$pi->get_by_employee_id( $employee_id );
//print_r($personal_info);
// initiate FPDI
$pdf = new FPDI('P', 'mm', 'Letter');
// add a page
$pdf->AddPage();
// set the sourcefile
//$pdf->setSourceFile('dtr/template/service_record/service_record.pdf');
// import page 1
//$tplIdx = $pdf->importPage(1);
// use the imported page and place it at point 10,10 with a width of 100 mm
//$pdf->useTemplate($tplIdx, 1, 1, 210);
// now write some text above the imported page
$pdf->SetFont('Arial');
$pdf->SetTextColor(0, 0, 0);
$pdf->SetXY(15, 60);
$pdf->SetFont('Arial', '', 16);
$pdf->Cell(0, 3, "Employee's Service Record", '', 1, 'C', false);
$pdf->Ln(4);
$e = new Employee_m();
$e->get_by_id($employee_id);
$pdf->SetFont('Arial', '', 12);
$pdf->Cell(0, 8, "Employee No.:" . $e->employee_id, '', 1, 'L', false);
$pdf->Ln(2);
$pdf->SetFont('Arial', '', 12);
$pdf->Cell(0, 8, "Employee Name:" . $e->lname . ', ' . $e->fname . ' ' . $e->mname, '', 1, 'L', false);
$pdf->Ln(4);
$pdf->Cell(0, 8, "Date From Date To Position Department Movement Status Status", '1', 1, 'L', false);
$pdf->Ln(4);
$work = new Work();
$work->where('govt_service', '1');
$work->order_by('inclusive_date_from', 'DESC');
$works = $work->get_by_employee_id($employee_id);
$i = 1;
$this->load->helper('text');
foreach ($works as $work) {
$pdf->SetFont('Arial', '', 8);
$pdf->SetX(10);
list($year, $month, $day) = explode('-', $work->inclusive_date_from);
$inclusive_date_from = $month . '/' . $day . '/' . $year;
$pdf->Write(0, $inclusive_date_from);
list($year, $month, $day) = explode('-', $work->inclusive_date_to);
$inclusive_date_to = $month . '/' . $day . '/' . $year;
if ($work->inclusive_date_to == 'Present') {
$inclusive_date_to = 'Present';
}
$pdf->SetX(29);
$pdf->Write(0, $inclusive_date_to);
$pdf->SetFont('Arial', '', 8);
$pdf->SetX(50);
$pdf->Write(0, str_replace('…', '..', character_limiter($work->position, 35)));
$pdf->SetX(100);
//$pdf->Write(0, $work->company);
$pdf->Write(0, str_replace('…', '..', character_limiter($work->company, 35)));
//$pdf->SetFont('Arial', '', 12);
$pdf->SetX(160);
$pdf->Write(0, $work->movement);
//$pdf->SetX(150);
//$pdf->Write(0, $work->salary_grade);
$pdf->SetFont('Arial', '', 8);
$pdf->SetX(185);
$pdf->Write(0, $work->status);
$work->govt_service = $work->govt_service == 1 ? 'Yes' : 'No';
$pdf->SetX(190);
//$pdf->Write(0, $work->govt_service);
$pdf->SetFont('Arial', '', 12);
if ($i == 6 || $i == 10 || $i == 13 || $i == 16 || $i == 19 || $i == 22) {
$pdf->Ln(8);
} else {
$pdf->Ln(7);
}
$i++;
}
$pdf->Cell(0, 8, "--------------------------------------------------------- Nothing Follows ---------------------------------------------------------", '', 1, 'C', false);
// Signatories
$pdf->Ln(15);
$pdf->SetX(20);
$pdf->Cell(90, 5, "PREPARED BY:", '0', 0, 'C', false);
$pdf->Cell(90, 5, "CERTIFIED CORRECT:", '0', 1, 'C', false);
$pdf->Ln(10);
$sr_prepared = Setting::getField('sr_prepared');
$sr_prepared_position = Setting::getField('sr_prepared_position');
$sr_certified = Setting::getField('sr_certified');
$sr_certified_position = Setting::getField('sr_certified_position');
$pdf->SetX(20);
$pdf->Cell(90, 5, $sr_prepared, '0', 0, 'C', false);
//4th param border
$pdf->Cell(90, 5, $sr_certified, '0', 1, 'C', false);
$pdf->SetX(20);
$pdf->Cell(90, 5, $sr_prepared_position, '0', 0, 'C', false);
$pdf->Cell(90, 5, $sr_certified_position, '0', 1, 'C', false);
// Output
$pdf->Output('dtr/template/service_record/archives/service_record_' . $employee_id . '.pdf', 'I');
//.........这里部分代码省略.........
示例12: ucwords
// select the first page
$tplIdx = $pdf->importPage(1);
// use the page we imported
$pdf->useTemplate($tplIdx);
//====================================================================
// Write to the document
//====================================================================
// set font, font style, font size.
$pdf->SetFont('Arial', '', 6);
$pdf->SetTextColor(0, 0, 0);
// set initial placement
$pdf->SetXY(29, 35);
// line break
//$pdf->Ln(5);
// go to 25 X (indent)
$pdf->SetX(62);
//================================INICIO DE DATOS DEL CLIENTE====================================//
$pdf->SetFont('Arial', '', 10);
$pdf->Write(0, utf8_decode($_POST['razonSocial']));
$pdf->SetFont('Arial', '', 10);
$pdf->SetX(157);
$pdf->Write(0, $_POST['fechaPropuesta']);
$pdf->Ln(5);
$pdf->SetX(62);
$pdf->Write(0, utf8_decode(ucwords(strtolower($_POST['numeroRUC']))));
$pdf->Ln(5);
$pdf->SetX(62);
$pdf->Write(0, ucwords(strtolower($_POST['nombreContacto'])));
$pdf->Ln(6);
$pdf->SetX(62);
$pdf->Write(0, utf8_decode($_POST['telefono']));
示例13: FPDI
file_put_contents('img.png', $unencodedData);
//Show the image
//echo '<img src="'.$_POST['img_val'].'" />';
$pdf = new FPDI();
$pdf->setSourceFile('TemplateReporte.pdf');
// seteamos la fuente, el estilo y el tamano
$pdf->SetFont('Times', 'B', 10);
// seteamos la posicion inicial
$pdf->SetXY(25, 80);
date_default_timezone_set('America/Bogota');
setlocale(LC_ALL, "es_ES");
$dias = array("Domingo", "Lunes", "Martes", "Miercoles", "Jueves", "Viernes", "Sábado");
$meses = array("Enero", "Febrero", "Marzo", "Abril", "Mayo", "Junio", "Julio", "Agosto", "Septiembre", "Octubre", "Noviembre", "Diciembre");
//agregamos una pagina
$pdf->AddPage();
$pdf->SetFont('Arial');
// seleccionamos la primera pagina del docuemnto importado
$tplIdx = $pdf->importPage(1);
// usamos la pagina importado como template
$pdf->useTemplate($tplIdx);
//seteamos la posicion X
$pdf->SetX(25);
//salto de linea
$pdf->Ln(55.2);
$pdf->SetFontSize(9);
$pdf->Write(0, utf8_decode(" " . $dias[date('w')] . " " . date('d') . " de " . $meses[date('n') - 1] . " del " . date('Y')));
$pdf->Image('img.png', 50, 110, 200);
unlink('img.png');
$pdf->Ln(155);
$pdf->Write(0, utf8_decode(" Relación de costos anuales sobre proyectos ejecutados con éxito."));
$pdf->Output();
示例14: define
function cto_apps($id = '')
{
$c = CompensatoryTimeoff::find($id);
$name = $this->Employee->get_employee_info($c->employee_id);
$office_name = $this->Office->get_office_name($name['office_id']);
$this->load->library('fpdf');
define('FPDF_FONTPATH', $this->config->item('fonts_path'));
$this->load->library('fpdi');
$pdf = new FPDI('P', 'mm', 'Legal');
// add a page
$pdf->AddPage();
// set the sourcefile
$pdf->setSourceFile('dtr/template/app_for_offset.pdf');
// select the first page
$tplIdx = $pdf->importPage(1);
// use the page we imported
$pdf->useTemplate($tplIdx);
// set font, font style, font size.
$pdf->SetFont('Arial', 'B', 12);
// set initial placement
$pdf->SetXY(158, 10.5);
$pdf->Write(0, 'Tracking no: ' . $id);
$pdf->Ln(9);
$pdf->SetX(158);
$pdf->Ln(20);
// go to 25 X (indent)
$pdf->SetX(12);
$this->Office->fields = array('office_code');
$office = $this->Office->get_office_info($name['office_id']);
// write office
$pdf->SetFont('Arial', 'B', 10);
$pdf->Write(0, $office['office_name']);
$pdf->SetFont('Arial', 'B', 12);
//lname
$pdf->SetX(99);
$pdf->Write(0, $name['lname']);
//fname
$pdf->SetX(145);
$pdf->Write(0, $name['fname']);
//mname
$pdf->SetX(187);
$pdf->Write(0, $name['mname'][0] . '.');
$pdf->Ln(10);
//date of file
$pdf->SetX(20);
$pdf->Write(0, $c->date_file);
//position
$pdf->SetFont('Arial', 'B', 10);
$pdf->SetX(63);
$pdf->Write(0, $name['position']);
$pdf->SetFont('Arial', 'B', 12);
// We need to check what salary grade the office use
if ($office['salary_grade_type'] == 'hospital') {
$this->Salary_grade->salary_grade_type = 'hospital';
}
//monthly salary
$pdf->SetX(140);
$pdf->Write(0, 'P ' . number_format($this->Salary_grade->get_monthly_salary($name['salary_grade'], $name['step']), 2));
$days = 'day';
if ($c->days > 1) {
$days = 'days';
}
$pdf->Ln(13);
$pdf->SetX(30);
$pdf->Write(0, $c->days . ' ' . $days);
$pdf->SetX(140);
//$pdf->Write(0, 'daily rate here');
$pdf->Ln(13);
$pdf->SetX(50);
$pdf->Write(0, $this->Helps->get_month_name($c->month) . ' ' . $c->dates . ', ' . $c->year);
$cto_balances_as_of = date("F d, Y", strtotime($c->date_file . "-1 day"));
$pdf->SetXY(30, 106);
$pdf->Write(0, $cto_balances_as_of);
// Compute balances
// (balance + earn) - spent
$cto = CompensatoryTimeoff::getBalance($c->employee_id);
//$balance = $cto->days;
$balance = $cto;
$cto = CompensatoryTimeoff::getEarnedSpent($c->employee_id);
//$earn = $cto->days;
$earn = $cto;
$cto = CompensatoryTimeoff::getEarnedSpent($c->employee_id, 'spent');
//$spent = $cto->days;
$spent = $cto;
$total_balance = $balance + $earn - $spent;
$pdf->SetXY(35, 116);
$pdf->Write(0, $total_balance);
$pdf->SetX(87);
$pdf->Write(0, '');
// hours here
// Get office head
$office = $this->Office->get_office_info($name['office_id']);
// If detailed
if ($name['detailed_office_id'] != 0) {
$detailed_office = $this->Office->get_office_info($name['detailed_office_id']);
$office['office_head'] = $detailed_office['office_head'];
$office['position'] = $detailed_office['position'];
}
// If Employee is Department head
$o = new Office_m();
//.........这里部分代码省略.........
示例15: explode
$texto = $row2["SA_OBSERVACIONES"];
$pdf->WordWrap($texto, 176);
$texto = explode("\n", $texto);
for ($i=0; $i<count($texto); $i++) {
if ($i > 1)
break;
$str = trim($texto[$i]);
$pdf->Cell(1);
$pdf->Cell(0, 0, $str);
$pdf->Ln(4.2);
}
$pdf->SetY(235.4);
$pdf->SetX(76);
$pdf->Cell(44, 0, $row2["SA_LUGARSUSCRIPCION"]);
$pdf->Cell(10);
$pdf->Cell(8, 0, $row2["DIASUSCRIPCION"]);
$pdf->Cell(22);
$pdf->Cell(27, 0, $row2["MESSUSCRIPCION"], 0, 0, "C");
$pdf->Cell(6);
$pdf->Cell(10, 0, $row2["ANOSUSCRIPCION"]);
$pdf->Ln(9.4);
$pdf->Cell(24);
$pdf->Cell(71, 0, $row2["NOMBRECOMERCIALIZADOR"]);