本文整理汇总了PHP中PDF::write方法的典型用法代码示例。如果您正苦于以下问题:PHP PDF::write方法的具体用法?PHP PDF::write怎么用?PHP PDF::write使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类PDF
的用法示例。
在下文中一共展示了PDF::write方法的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: ConnectionHandler
$this->SetFont('Arial', '', 10);
$this->MultiCell(0, 5, $this->pie, 0, C);
}
}
$db = new ConnectionHandler("{$ruta_raiz}");
$db->conn->SetFetchMode(ADODB_FETCH_ASSOC);
$pdf = new PDF('p', 'mm', 'letter');
$pdf->pie = $pie;
$pdf->AddPage();
$pdf->SetTitle("Departamento Nacional de Planeacion");
$pdf->SetLeftMargin(25);
$pdf->SetRightMargin(25);
$pdf->SetFont('Arial', 'B', 12);
$pdf->Cell(50, 5, $numradicado, 0, 1, L);
$pdf->Cell(105, 5, $lugar . "., " . $fecha, 0, 1, L);
$pdf->ln(18);
$pdf->SetFont('Arial', '', 12);
$pdf->write(5, $asu);
$pdf->ln(25);
$pdf->Cell(60, 5, $mensaje, 0, 1, L);
$pdf->ln(5);
$pdf->MultiCell(0, 5, $reseptor, 0, L);
$primerno = substr($numRadicadoPadre, 0, 4);
$segundono = substr($numRadicadoPadre, 4, 3);
$ruta = "/" . $primerno . "/" . $segundono . "/docs/" . $numradicado;
$adjuntos = BODEGAPATH . $ruta;
$pdf->Output($adjuntos . '.pdf', 'f');
$enlace = "../bodega" . $ruta . '.pdf';
radi_paht($db, $ruta, $numradicado);
return $numradicado . '.pdf';
}
示例2: generate
public static function generate($dbh, $appID, $method = 'I')
{
$data = self::get($dbh, $appID);
//if (strlen($socialnumber) > 20) $socialnumber = $this->decrypt($socialnumber);
$socialnumber = '';
//Blank out social on forms per Maria 6/6/2013
// initiate PDF
$pdf = new PDF();
$pdf->SetMargins(PDF_MARGIN_LEFT, 10, PDF_MARGIN_RIGHT);
// add a page
$pdf->AddPage();
$pdf->SetFont("Helvetica", "", 11);
$pdf->SetXY(33, 30);
$pdf->Write(5, date('m/d/Y', strtotime($data['appDate'])));
$pdf->SetXY(85, 30);
$pdf->Write(5, $data['jobName']);
$pdf->SetXY(30, 36);
$pdf->Write(5, $data['lastname']);
$pdf->SetXY(110, 36);
$pdf->Write(5, $data['firstname']);
$pdf->SetXY(170, 36);
$pdf->Write(5, $data['middlename']);
$pdf->SetXY(30, 62);
$pdf->Write(5, $data['address']);
$pdf->SetXY(105, 62);
$pdf->Write(5, $data['city']);
$pdf->SetXY(162, 62);
$pdf->Write(5, $data['state']);
$pdf->SetXY(187, 62);
$pdf->Write(5, $data['zip']);
$pdf->SetXY(70, 69);
$pdf->Write(5, $data['years']);
$pdf->SetXY(105, 69);
$pdf->Write(5, $data['phone']);
$pdf->SetXY(122, 76);
$pdf->Write(5, $data['email']);
$pdf->SetFont("Helvetica", "", 10);
$highestx = 59 + $data['highestgrade'] * 5.4;
if ($data['highestgrade'] > 8) {
$highestx += 19;
}
if ($data['highestgrade'] > 12) {
$highestx += 20;
}
$pdf->SetXY($highestx, 152);
$pdf->Write(5, 'Highest');
$pdf->SetXY(46, 175);
$pdf->Write(5, $data['highschool']);
$pdf->SetXY(46, 184);
$pdf->Write(5, $data['highschoolloc']);
$pdf->SetXY(101, 175);
$pdf->Write(5, $data['highschoolyears']);
$pdf->SetXY(129, 175);
$pdf->Write(5, $data['coursesubject']);
$pdf->SetXY(174.5, 175);
$pdf->write(5, $data['coursesubjectgraduated'] == 'Yes' ? 'X' : '');
$pdf->SetXY(174.5, 184);
$pdf->write(5, $data['coursesubjectgraduated'] == 'GED' ? 'X' : '');
$pdf->SetXY(46, 193);
$pdf->Write(5, $data['collegeuniversity']);
$pdf->SetXY(46, 202);
$pdf->Write(5, $data['collegeuniversityloc']);
$pdf->SetXY(101, 193);
$pdf->Write(5, $data['collegeuniversityyearscompleted']);
$pdf->SetXY(129, 193);
$pdf->Write(5, $data['collegeuniversitycourse']);
$pdf->SetXY(174.5, 191);
$pdf->write(5, $data['collegegraduated'] == 'Yes' ? 'X' : '');
$pdf->SetXY(184, 194);
$pdf->Write(5, $data['collegegraduatedMonth']);
$pdf->SetXY(196, 194);
$pdf->Write(5, $data['collegegraduatedYear']);
$pdf->SetXY(174.5, 202);
$pdf->write(5, $data['collegegraduated'] == 'InP' ? 'X' : '');
$pdf->SetXY(46, 210);
$pdf->Write(5, $data['othercollege']);
$pdf->SetXY(46, 222);
$pdf->Write(5, $data['othercollegeloc']);
$pdf->SetXY(101, 214);
$pdf->Write(5, $data['othercollegeyears']);
$pdf->SetXY(129, 210);
$pdf->Write(5, $data['othercollegecourse']);
$pdf->SetXY(174.5, 209);
$pdf->write(5, $data['othercollegecompleted'] == 'Yes' ? 'X' : '');
$pdf->SetXY(184, 213);
$pdf->Write(5, $data['othercollegecompletedMonth']);
$pdf->SetXY(194, 213);
$pdf->Write(5, $data['othercollegecompletedYear']);
$pdf->SetXY(174.5, 219);
$pdf->write(5, $data['othercollegecompleted'] == 'Pro' ? 'X' : '');
$pdf->SetXY(128, 260.5);
$pdf->Write(5, $data['language']);
$pdf->SetXY(163, 260.5);
$pdf->write(5, $data['languagespeak'] ? 'X' : '');
$pdf->SetXY(177, 260.5);
$pdf->write(5, $data['languageread'] ? 'X' : '');
$pdf->SetXY(190, 260.5);
$pdf->write(5, $data['languagewrite'] ? 'X' : '');
$pdf->AddPage();
$y = 0;
//.........这里部分代码省略.........
示例3:
$pdf->AliasNbPages();
$pdf->AddPage();
//parameter could be path where you want to save pdf
$pdf->SetFont("Times", "", "12");
//"fontfamily","fontstyle","fontsize"
for ($i = 1; $i <= 40; $i++) {
$pdf->Cell(0, 10, "My PDF PAGE" . $i, 0, 1, "C");
}
//width,height ,,content,border,1->newline 0->append in same line ,alignment
$pdf->SetFont("Arial", "", "10");
//"fontfamily","fontstyle","fontsize"
$pdf->Cell(0, 10, "Second line", 0, 1, "C");
//width,height ,,content,border,1->newline 0->append in same line ,alignment
$pdf->SetFont("Arial", "", "10");
//"fontfamily","fontstyle","fontsize"
$pdf->write(5, "data");
//height_of_data, content
$pdf->Output();
?>
<?//php
// if(!empty($_POST['submit']))
// {
// $f_name = $_POST['first_name'];
// $l_name = $_POST['last_name'];
// require("fpdf/fpdf.php");
// $pdf = new FPDF();
// $pdf->AddPage();
// //var_dump(get_class_methods($pdf));
// $pdf->SetFont('Arial','B','15');
示例4: Cell
$pdf -> Cell(0,5, 'FINEBOOK', '0','1', 'C', false);
$pdf -> SetFont('Arial', 'i', 8);
$pdf -> Cell(0,5, 'Semoga kita selalu berada dalam lindungan Allah SWT', '0', '1', 'C', false);
$pdf -> Ln(3);
$pdf -> Cell(190,0.6,'','0','1', 'C', true);
$pdf -> Ln(5);
$pdf -> SetFont('Arial', 'B', 9);
$pdf -> Cell(50,5, 'LAPORAN BUKU', '0','1', 'L', false);
$pdf -> Ln(3);
*/
$pdf->SetFont('Arial', 'B', 9);
$pdf->Cell(0, 5, 'LAPORAN BUKU', '0', '1', 'C', false);
$pdf->ln();
$pdf->SetFont('Arial', 'B', 8);
$pdf->write(5, 'Berikut adalah data buku yang sudah masuk FINEBOOK pada bulan Januari 2016 :');
$pdf->ln(10);
$pdf->SetFont('Arial', 'B', 8);
$pdf->Cell(8, 9, 'No', 1, 0, 'C');
$pdf->Cell(17, 9, 'Kode Buku', 1, 0, 'C');
$pdf->Cell(55, 9, 'Judul Buku', 1, 0, 'C');
$pdf->Cell(40, 9, 'Penerbit', 1, 0, 'C');
$pdf->Cell(20, 9, 'Tahun Terbit', 1, 0, 'C');
$pdf->Cell(37, 9, 'Kategori', 1, 0, 'C');
$pdf->Cell(15, 9, 'Harga', 1, 0, 'C');
$pdf->Ln(0);
$no = 0;
$query = mysql_query("select * from buku");
while ($data = mysql_fetch_array($query)) {
$no++;
$pdf->Ln(10);
示例5: PDF
$this->Write(1, 'DINAS SOSIAL DAN TENAGA KERJA');
$this->Ln(3);
$this->Cell(15);
$this->Write(1, 'Jl. K.H. WAHID HASYIM NO. 14');
$this->Ln(3);
$this->Cell(25);
$this->Write(1, 'MEDAN - 20145');
$this->Line(3, 27, 90, 27);
$this->Ln(15);
}
}
$pdf = new PDF();
$pdf->AddPage();
$pdf->SetFont('Times', '', 10);
$pdf->Cell(8);
$pdf->write(0, $baris1);
$pdf->Ln(5);
$pdf->Cell(10);
$pdf->write(0, 'NOMOR URUT AGENDA : ');
$pdf->Write(0, $baris1);
$pdf->Ln(10);
$pdf->Cell(1);
$pdf->write(0, 'TANGGAL : ');
$pdf->Write(0, $baris1);
$pdf->Ln(5);
$pdf->Cell(1);
$pdf->write(0, 'NAMA PERUSAHAAN : ');
$pdf->Write(0, $baris1);
$pdf->Ln(5);
$pdf->Cell(1);
$pdf->write(0, 'ALAMAT PERUSAHAAN : ');
示例6: PutLink
}
function PutLink($URL, $txt)
{
// Put a hyperlink
$this->setTextColor(0, 0, 255);
$this->setStyle('U', true);
$this->write(5, $txt, $URL);
$this->setStyle('U', false);
$this->setTextColor(0);
}
}
$html = 'You can now easily print text mixing different styles: **bold**, <i>italic</i>,
<u>underlined</u>, or **<i><u>all at once</u></i>**!You can also insert links on
text, such as <a href="http://www.fpdf.org">www.fpdf.org</a>, or on an image: click on the logo.';
$pdf = new PDF();
// First page
$pdf->addPage();
$pdf->setFont('Arial', '', 20);
$pdf->write(5, "To find out what's new in this tutorial, click ");
$pdf->setFont('', 'U');
$link = $pdf->addLink();
$pdf->write(5, 'here', $link);
$pdf->setFont('');
// Second page
$pdf->addPage();
$pdf->setLink($link);
$pdf->image('logo.png', 10, 12, 30, 0, '', 'http://www.fpdf.org');
$pdf->setLeftMargin(45);
$pdf->setFontSize(14);
$pdf->writeHTML($html);
$pdf->output();
示例7: PDF
/**
* print_PDF prints the Repertory result table in an PDF file.
*
* @param string $task 'save_PDF'|'print_PDF': if 'save_PDF' the PDF should get downloaded, if 'print_PDF' the PDF should open in the browser
* @return void
* @access public
*/
function print_PDF($task)
{
global $session;
if ($task == 'save_PDF') {
$dest = 'D';
} else {
$dest = 'I';
}
if ($session->lang == 'de') {
$date = $this->date_to_german($this->date);
} else {
$date = $this->date;
}
$pdf = new PDF('L');
$pdf->SetTopMargin(20);
$pdf->SetFont('Arial', '', 12);
$pdf->SetTitle(_("Repertorization result"), true);
$pdf->SetAuthor(_("OpenHomeopath"), true);
$pdf->SetCreator(_("openhomeo.org"), true);
$pdf->AddPage();
$w1 = $pdf->GetStringWidth(_('Patient:') . ' ' . _('Rep.-Date:') . ' ');
$w3 = $pdf->GetStringWidth(_('Case taking:') . ' ');
$w4 = $pdf->GetStringWidth(_('Prescription:') . ' ' . _('Rep.-No.:') . ' ');
$pdf->SetFont('', 'B');
$w2 = $pdf->GetStringWidth(iconv('UTF-8', 'windows-1252', $this->patient) . $date . $date);
$pdf->SetFont('', '');
$pdf->write(7, _('Patient:') . ' ');
$pdf->SetFont('', 'B');
$pdf->write(7, iconv('UTF-8', 'windows-1252', $this->patient));
$pdf->SetFont('', '');
// Move to the right
$pdf->Cell(295 - ($w1 + $w2));
$pdf->Cell(0, 7, _('Rep.-Date:') . ' ');
$pdf->SetFont('', 'B');
$pdf->Cell(0, 7, $date, 0, 1, 'R');
$pdf->SetFont('', '');
$pdf->write(7, _('Prescription:') . ' ');
$pdf->SetFont('', 'B');
$pdf->write(7, iconv('UTF-8', 'windows-1252', $this->prescription));
if (!empty($this->rep_id)) {
$pdf->SetFont('', '');
// Move to the right
$pdf->Cell(295 - ($w1 + $w2));
$pdf->Cell(0, 7, _('Rep.-No.:') . ' ');
$pdf->SetFont('', 'B');
$pdf->Cell(0, 7, $this->rep_id, 0, 1, 'R');
} else {
$pdf->Ln(7);
}
$pdf->SetFont('', '');
$pdf->write(7, _('Case taking:') . ' ');
$pdf->SetFont('', 'I', 11);
$pdf->Cell(0, 1, "", 0, 2);
$note_ar = explode("%br", $this->note);
foreach ($note_ar as $note_line) {
$pdf->Cell(0, 5, iconv('UTF-8', 'windows-1252', $note_line), 0, 2);
}
// Line break
$pdf->Ln(10);
$header_ar = array();
$first_row_ar = array();
$data_ar = array();
$this->get_table_data($header_ar, $first_row_ar, $data_ar, $summary);
$pdf->create_result_table($header_ar, $first_row_ar, $data_ar, 70);
$pdf->SetFont('Arial', '', 10);
$pdf->Ln(5);
$pdf->write(7, iconv('UTF-8', 'windows-1252', $summary));
$pdf->Output("OpenHomeopath_" . _("Repertorization result") . "_" . date("Y-m-d_H-i") . ".pdf", $dest);
}
示例8: generate
public static function generate($dbh, $appID, $method = 'I')
{
$data = self::get($dbh, $appID);
//if (strlen($socialnumber) > 20) $socialnumber = $this->decrypt($socialnumber);
$socialnumber = '';
//Blank out social on forms per Maria 6/6/2013
// initiate PDF
$pdf = new PDF();
$pdf->SetMargins(PDF_MARGIN_LEFT, 10, PDF_MARGIN_RIGHT);
// add a page
$pdf->AddPage();
$pdf->SetFont("Helvetica", "", 11);
$pdf->SetXY(150, 37);
$pdf->Write(5, date('m/d/Y', strtotime($data['appDate'])));
$pdf->SetXY(45, 45);
$pdf->Write(5, $data['lastname']);
$pdf->SetXY(100, 45);
$pdf->Write(5, $data['firstname']);
$pdf->SetXY(150, 45);
$pdf->Write(5, $data['middlename']);
$pdf->SetXY(40, 95);
$pdf->Write(5, $data['address']);
$pdf->SetXY(95, 95);
$pdf->Write(5, $data['city']);
$pdf->SetXY(125, 95);
$pdf->Write(5, $data['state']);
$pdf->SetXY(150, 95);
$pdf->Write(5, $data['zip']);
/*
$pdf->SetXY(70, 69);
$pdf->Write(5, $data['years']);
*/
$pdf->SetXY(125, 55);
$pdf->Write(5, $data['phone']);
$pdf->SetXY(32, 66);
$pdf->Write(5, $data['referral']);
$pdf->SetXY(15, 82);
$pdf->Write(5, $data['othername']);
$pdf->SetXY(15, 111);
$pdf->Write(5, $data['friendsRelatives']);
$pdf->SetXY(30, 131);
$pdf->Write(5, $data['jobName']);
$pdf->SetXY(130, 131);
$pdf->Write(5, date('m/d/Y', strtotime($data['dateStart'])));
$pdf->SetXY(46, 140);
$pdf->Write(5, $data['expectedPay']);
$pdf->SetXY(140, 140);
$pdf->Write(5, $data['employeedNow']);
$pdf->SetXY(86, 148);
$pdf->Write(5, $data['contactEmployer']);
$pdf->SetXY(80, 156);
$pdf->Write(5, $data['haveYouWorkPreviously']);
$pdf->SetXY(130, 156);
$pdf->Write(5, $data['workedHereWhen']);
$pdf->SetXY(80, 164);
$pdf->Write(5, $data['appliedHere']);
$pdf->SetXY(130, 164);
$pdf->Write(5, $data['appliedHereWhen']);
$pdf->SetXY(69, 173.5);
$pdf->write(5, $data['workFullTime'] ? 'X' : '');
$pdf->SetXY(90, 173.5);
$pdf->write(5, $data['workPartTime'] ? 'X' : '');
$pdf->SetXY(113, 173.5);
$pdf->write(5, $data['workSeasonal'] ? 'X' : '');
/*
workFullTime=:workFullTime,
workPartTime=:workPartTime,
workSeasonal=:workSeasonal,
*/
$pdf->SetFont("Helvetica", "", 10);
$highestgrade = intval($data['highestgrade']);
if ($highestgrade) {
$highestx = 30 + $highestgrade * 6;
$pdf->SetXY($highestx, 220);
$pdf->Write(5, 'X');
}
if ($data['highschoolyears']) {
$highestx = 78 + $data['highschoolyears'] * 8;
}
$pdf->SetXY($highestx, 220);
$pdf->Write(5, 'X');
if ($data['collegeyears']) {
$collegeyearsx = 110 + $data['collegeyears'] * 8;
$pdf->SetXY($collegeyearsx, 220);
$pdf->Write(5, 'X');
}
if ($data['othercollegeyears']) {
$othercollegeyearsx = 142 + $data['othercollegeyears'] * 8;
$pdf->SetXY($othercollegeyearsx, 220);
$pdf->Write(5, 'X');
}
$pdf->SetXY(51, 200);
$pdf->MultiCell(30, 4.5, $data['gradeSchool'], 0, 'L');
$pdf->SetXY(51, 212);
$pdf->Write(5, $data['gradeSchoolLoc']);
$pdf->SetXY(83, 200);
$pdf->MultiCell(30, 4.5, $data['highschool'], 0, 'L');
$pdf->SetXY(83, 212);
$pdf->Write(5, $data['highschoolloc']);
/*
//.........这里部分代码省略.........
示例9: PDF
$this->Ln(3);
$this->Cell(15);
$this->Write(1, 'Jl. K.H. WAHID HASYIM NO. 14');
$this->Ln(3);
$this->Cell(25);
$this->Write(1, 'MEDAN - 20145');
$this->Line(3, 27, 90, 27);
$this->Ln(15);
}
}
$pdf = new PDF();
$pdf->AddPage();
$pdf->SetFont('Times', '', 10);
if ($jenis_urus == '02') {
$pdf->Cell(24);
$pdf->write(0, $pengurusan);
}
if ($jenis_urus == '01') {
$pdf->Cell(22);
$pdf->write(0, $pengurusan);
} else {
$pdf->Cell(8);
$pdf->write(0, $pengurusan);
}
$pdf->Ln(5);
$pdf->Cell(10);
$pdf->write(0, 'NOMOR URUT AGENDA : ');
$pdf->Write(0, $no_resi);
$pdf->Ln(5);
$pdf->Cell(1);
$pdf->write(0, 'CATATAN : ');