本文整理汇总了PHP中FPDF::AddPage方法的典型用法代码示例。如果您正苦于以下问题:PHP FPDF::AddPage方法的具体用法?PHP FPDF::AddPage怎么用?PHP FPDF::AddPage使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类FPDF
的用法示例。
在下文中一共展示了FPDF::AddPage方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: PurchaseOrderModel
function export_order($id)
{
global $FANNIE_OP_DB, $FANNIE_ROOT;
$dbc = FannieDB::get($FANNIE_OP_DB);
$order = new PurchaseOrderModel($dbc);
$order->orderID($id);
$order->load();
$items = new PurchaseOrderItemsModel($dbc);
$items->orderID($id);
$vendor = new VendorsModel($dbc);
$vendor->vendorID($order->vendorID());
$vendor->load();
$contact = new VendorContactModel($dbc);
$contact->vendorID($order->vendorID());
$contact->load();
if (!class_exists('FPDF')) {
include_once $FANNIE_ROOT . 'src/fpdf/fpdf.php';
}
$pdf = new FPDF('P', 'mm', 'Letter');
$pdf->AddPage();
$pdf->SetFont('Arial', '', '12');
$pdf->Cell(100, 5, 'Vendor: ' . $vendor->vendorName(), 0, 0);
$pdf->Cell(100, 5, 'Date: ' . date('Y-m-d'), 0, 0);
$pdf->Ln();
$pdf->Cell(100, 5, 'Phone: ' . $contact->phone(), 0, 0);
$pdf->Cell(100, 5, 'Fax: ' . $contact->fax(), 0, 0);
$pdf->Ln();
$pdf->Cell(100, 5, 'Email: ' . $contact->email(), 0, 0);
$pdf->Cell(100, 5, 'Website: ' . $contact->website(), 0, 0);
$pdf->Ln();
$pdf->MultiCell(0, 5, "Ordering Info:\n" . $contact->notes(), 'B');
$pdf->Ln();
$cur_page = 0;
$pdf->SetFontSize(10);
foreach ($items->find() as $obj) {
if ($cur_page != $pdf->PageNo()) {
$cur_page = $pdf->PageNo();
$pdf->Cell(25, 5, 'SKU', 0, 0);
$pdf->Cell(20, 5, 'Order Qty', 0, 0);
$pdf->Cell(30, 5, 'Brand', 0, 0);
$pdf->Cell(65, 5, 'Description', 0, 0);
$pdf->Cell(20, 5, 'Case Size', 0, 0);
$pdf->Cell(20, 5, 'Est. Cost', 0, 0);
$pdf->Ln();
}
$pdf->Cell(25, 5, $obj->sku(), 0, 0);
$pdf->Cell(20, 5, $obj->quantity(), 0, 0, 'C');
$pdf->Cell(30, 5, $obj->brand(), 0, 0);
$pdf->Cell(65, 5, $obj->description(), 0, 0);
$pdf->Cell(20, 5, $obj->caseSize(), 0, 0, 'C');
$pdf->Cell(20, 5, sprintf('%.2f', $obj->caseSize() * $obj->unitCost() * $obj->quantity()), 0, 0);
$pdf->Ln();
}
$pdf->Output('order_export.pdf', 'D');
}
示例2: exportpdf
public function exportpdf()
{
if ($this->data['users']->role != "admin") {
exit;
}
$header = array('Full Name', 'User Name', 'E-mail', 'Gender', 'Address', 'Phone No', 'Mobile No', 'Profession');
$data = array();
$student = User::where('role', 'parent')->get();
foreach ($student as $value) {
$data[] = array($value->fullName, $value->username, $value->email, $value->gender, $value->address, $value->phoneNo, $value->mobileNo, $value->parentProfession);
}
$pdf = new FPDF();
$pdf->SetFont('Arial', '', 10);
$pdf->AddPage();
foreach ($header as $col) {
$pdf->Cell(40, 7, $col, 1);
}
$pdf->Ln();
foreach ($data as $row) {
foreach ($row as $col) {
$pdf->Cell(40, 6, $col, 1);
}
$pdf->Ln();
}
$pdf->Output();
exit;
}
示例3: preprocess
function preprocess()
{
if (FormLib::get_form_value('start', False) !== False) {
$pdf = new FPDF('P', 'in', 'Letter');
$pdf->SetMargins(0.5, 0.5, 0.5);
$pdf->SetAutoPageBreak(False, 0.5);
$pdf->AddPage();
$start = FormLib::get_form_value('start');
$x = 0.5;
$y = 0.5;
$pdf->AddFont('Gill', '', 'GillSansMTPro-Medium.php');
$pdf->SetFont('Gill', '', 16);
for ($i = 0; $i < 40; $i++) {
$current = $start + $i;
$pdf->SetXY($x, $y);
$pdf->Cell(1.75, 0.5, $current, 0, 0, 'C');
$pdf->Cell(1.75, 0.5, $current, 0, 0, 'C');
if ($i % 2 == 0) {
$x += 1.75 * 2 + 0.5;
} else {
$x = 0.5;
$y += 0.5;
}
}
$pdf->Close();
$pdf->Output("mem stickers {$start}.pdf", "I");
return False;
}
return True;
}
示例4: generarFolleto
public function generarFolleto()
{
$concursos = $this->concursoMapper->findConcurso("pinchosOurense");
$establecimientos = $this->establecimientoMapper->findAllValidados();
$pinchos = $this->pincho->all();
$pdf = new FPDF();
$pdf->AddPage();
$pdf->SetFont('Arial', 'B', 30);
$pdf->SetTextColor(85, 53, 20);
$pos_y = 10;
$pdf->Cell(0, 24, $concursos->getNombre(), 0, 0, "L");
$pdf->Ln();
$pdf->SetFont('Arial', '', 16);
$pdf->SetTextColor(0, 0, 0);
$pdf->MultiCell(0, 6, $concursos->getDescripcionConcurso(), 0, "L");
$pdf->SetTextColor(85, 53, 20);
$pdf->SetFont('Arial', 'B', 13);
$pdf->Cell(0, 24, "Establecimientos participantes", 0, 0, "L");
foreach ($establecimientos as $establecimiento) {
$pdf->Ln();
$pdf->SetFont('Arial', 'B', 13);
$pdf->SetTextColor(85, 53, 20);
$pdf->SetFillColor(182, 145, 107);
$pdf->Cell(0, 10, utf8_decode($establecimiento->getNombre()), 1, 0, "C", "false");
$pdf->Ln();
$pdf->SetFont('Arial', 'I', 13);
$pdf->SetTextColor(0, 0, 0);
$pdf->Cell(0, 10, utf8_decode($establecimiento->getDescripcion()), 0, 0, "L");
$pdf->Ln();
$pdf->Cell(0, 10, utf8_decode($establecimiento->getLocalizacion()), 0, 0, "L");
$pdf->Ln();
$pdf->Cell(0, 10, utf8_decode("Pincho:"), 0, 0, "L");
foreach ($pinchos as $pincho) {
if ($pincho->getEstablecimiento() == $establecimiento->getId()) {
$pdf->Ln();
$pdf->Cell(5);
$pdf->Cell(0, 10, utf8_decode($pincho->getNombre()), 0, 0, "L");
$pdf->Ln();
$pdf->Cell(5);
$pdf->Cell(0, 10, utf8_decode($pincho->getDescripcion()), 0, 0, "L");
$pdf->Ln();
$pdf->Cell(5);
if ($pincho->isCeliaco()) {
$pdf->Cell(0, 10, utf8_decode("Apto para celiaco"), 0, 0, "L");
} else {
$pdf->Cell(0, 10, utf8_decode("No apto para celiaco"), 0, 0, "L");
}
}
}
$pdf->Ln(5);
}
$pdf->Output("folleto.pdf", "D");
}
示例5: drawPDF
public function drawPDF()
{
$pdf = new \FPDF('L', 'mm', 'Letter');
$pdf->SetMargins(3.175, 3.175, 3.175);
$pdf->SetAutoPageBreak(false);
if (\COREPOS\Fannie\API\FanniePlugin::isEnabled('CoopDealsSigns')) {
$this->font = 'Gill';
$this->alt_font = 'GillBook';
define('FPDF_FONTPATH', dirname(__FILE__) . '/../../../modules/plugins2.0/CoopDealsSigns/noauto/fonts/');
$pdf->AddFont('Gill', '', 'GillSansMTPro-Medium.php');
}
$pdf->SetFont($this->font, '', 16);
$data = $this->loadItems();
$width = 136.52;
$height = 105;
$top = 90;
$left = 15;
$effective_width = $width - 2 * $left;
foreach ($data as $item) {
$pdf->AddPage();
$column = 1;
// right aligned
$price = $this->printablePrice($item);
$pdf->SetXY($left + $width * $column, $top);
$pdf->SetFontSize($this->SMALL_FONT);
$pdf->Cell($effective_width, 10, $item['brand'], 0, 1, 'C');
$pdf->SetX($left + $width * $column);
$pdf->SetFontSize($this->MED_FONT);
$pdf->MultiCell($effective_width, 12, $item['description'], 0, 'C');
$pdf->SetX($left + $width * $column);
$pdf->SetFontSize($this->BIG_FONT);
$pdf->Cell($effective_width, 25, $price, 0, 1, 'C');
$y_pos = $pdf->GetY();
if ($item['startDate'] != '' && $item['endDate'] != '') {
// intl would be nice
$datestr = $this->getDateString($item['startDate'], $item['endDate']);
$pdf->SetXY($left + $width * $column, $top + ($height - 40));
$pdf->SetFontSize($this->SMALL_FONT);
$pdf->Cell($effective_width, 20, $datestr, 0, 1, 'R');
}
if ($item['originName'] != '') {
$pdf->SetXY($left + $width * $column, $y_pos);
$pdf->SetFontSize($this->SMALL_FONT);
if (strlen($item['originName']) < 50) {
$pdf->Cell($effective_width, 20, $item['originName'], 0, 1, 'L');
} else {
$pdf->Cell($effective_width, 20, $item['originShortName'], 0, 1, 'L');
}
}
}
$pdf->Output('WfcProdSingle.pdf', 'I');
}
示例6: generatePDF
function generatePDF($print_id, $print_type = 1)
{
include "config.php";
require_once 'fpdf/fpdf.php';
$db = go\DB\DB::create($db_params, 'mysql');
$db->query('SET CHARACTER SET cp1251');
$get_print = $db->query('SELECT `finish_number`, `valve_type_id` FROM {numbers} WHERE `print_id`=?', array($_GET['print_id']))->assoc();
$get_print_info = $db->query('SELECT DISTINCT(`nm`.`order`) as `order`, `us`.`name` as `name`, `nm`.`print_id` as `print_id` FROM {numbers} `nm` LEFT JOIN {users} `us` ON (`nm`.`user_id` = `us`.`id`) WHERE `print_id`=?', array($_GET['print_id']))->row();
define('FPDF_FONTPATH', 'fpdf/fonts');
$pdf = new FPDF("L", "mm", array("88", "7"));
$pdf->AddFont('Arial-BoldMT', 'B', 'arial_bold.php');
$pdf->SetFont('Arial-BoldMT', 'B', 11);
$pdf->SetTextColor(0);
//Add info for this order
$pdf->AddPage('L');
$pdf->SetAutoPageBreak(false);
$pdf->SetXY(0, 0);
$pdf->Cell(43, 7, $get_print_info['name'], 0, 0, "C", 0);
$pdf->Cell(4, 7, '', 0, 0, "C", 0);
$pdf->Cell(43, 7, $get_print_info['order'], 0, 0, "C", 0);
//End of add
for ($i = 0; $i < count($get_print); $i++) {
$pdf->AddPage('L');
$pdf->SetAutoPageBreak(false);
$pdf->SetXY(0, 0);
$pdf->Cell(43, 7, 'Ser.: ' . $get_print[$i]['finish_number'], 0, 0, "C", 0);
$pdf->Cell(4, 7, '', 0, 0, "C", 0);
if ($i + $print_type < count($get_print)) {
$pdf->Cell(43, 7, 'Ser.: ' . $get_print[$i + $print_type]['finish_number'], 0, 0, "C", 0);
}
$pdf->SetAutoPageBreak(false);
$i += $print_type;
}
return $pdf->Output($get_print_info['print_id'] . '.pdf', 'I');
}
示例7: EWD_UFAQ_Export_To_PDF
function EWD_UFAQ_Export_To_PDF()
{
require_once EWD_UFAQ_CD_PLUGIN_PATH . '/FPDF/fpdf.php';
if ($Category != "EWD_UFAQ_ALL_CATEGORIES") {
$category_array = array('taxonomy' => 'ufaq-category', 'field' => 'slug', 'terms' => $Category->slug);
}
$params = array('posts_per_page' => -1, 'post_type' => 'ufaq');
$faqs = get_posts($params);
$PDFPasses = array("FirstPageRun", "SecondPageRun", "Final");
foreach ($PDFPasses as $PDFRun) {
$pdf = new FPDF();
$pdf->AddPage();
if ($PDFRun == "SecondPageRun" or $PDFRun == "Final") {
$pdf->SetFont('Arial', 'B', 14);
$pdf->Cell(20, 10, "Page #");
$pdf->Cell(20, 10, "Article Title");
$pdf->Ln();
$pdf->SetFont('Arial', '', 12);
foreach ($ToC as $entry) {
$pdf->Cell(20, 5, " " . $entry['page']);
$pdf->MultiCell(0, 5, $entry['title']);
$pdf->Ln();
}
unset($ToC);
}
foreach ($faqs as $faq) {
$PostTitle = strip_tags(html_entity_decode($faq->post_title));
$PostText = strip_tags(html_entity_decode($faq->post_content));
$PostText = str_replace("[", "[", $PostText);
$PostText = str_replace("]", "]", $PostText);
$pdf->AddPage();
$Entry['page'] = $pdf->page;
$Entry['title'] = $PostTitle;
$pdf->SetFont('Arial', 'B', 15);
$pdf->MultiCell(0, 10, $PostTitle);
$pdf->Ln();
$pdf->SetFont('Arial', '', 12);
$pdf->MultiCell(0, 10, $PostText);
$ToC[] = $Entry;
unset($Entry);
}
if ($PDFRun == "FirstPageRun" or $PDFRun == "SecondPageRun") {
$pdf->Close();
}
if ($PDFRun == "Final") {
$pdf->Output('Ultimate-FAQ-Manual.pdf', 'D');
}
}
}
示例8: post_id_handler
public function post_id_handler()
{
if (!is_array($this->id)) {
$this->id = array($this->id);
}
$today = date("F j, Y");
$pdf = new FPDF('L', 'in', array(3.5, 5.0));
$pdf->AddFont('Gill', '', 'GillSansMTPro-Medium.php');
$primary = "";
$pdf->SetAutoPageBreak(true, 0);
$pdf->SetFont("Gill", "", 10);
//Meat of the statement
foreach ($this->id as $card_no) {
$account = \COREPOS\Fannie\API\member\MemberREST::get($card_no);
$pdf->AddPage();
$pdf->SetXY(3.0, 1.45);
foreach ($account['customers'] as $c) {
if ($c['accountHolder']) {
$pdf->Cell(2, 0.25, $c['firstName'] . ' ' . $c['lastName'], "", 1, "L");
break;
}
}
$pdf->SetX(3.0);
$pdf->Cell(2, 0.25, $account['addressFirstLine'], "", 1, "L");
if ($account['addressSecondLine']) {
$pdf->SetX(3.0);
$pdf->Cell(2, 0.25, $account['addressSecondLine'], "", 1, "L");
}
$pdf->SetX(3.0);
$str = $account['city'] . ", " . $account['state'] . " " . $account['zip'];
$pdf->Cell(2, 0.25, $str, "", 1, "L");
}
$pdf->Output('member postcards.pdf', 'D');
return false;
}
示例9: geraEtiquetasPDF
function geraEtiquetasPDF($qrcode, $qnt, $nome)
{
$pdf = new FPDF("P", "pt", "A4");
$pdf->AddPage();
$posY = 3;
$posX = 5;
$controle = 0;
$qntElementos = 1;
for ($k = 1; $k <= 80; $k += 4) {
// linha
for ($j = 1; $j <= 5; $j++) {
// coluna
$pdf->Image("../etiquetas/{$qrcode[$controle]}.png", $posX, $posY, 114, 38);
$controle++;
$posX += 119;
if ($qntElementos == $qnt) {
$k = 80;
$j = 5;
}
$qntElementos++;
}
if ($posY < 748) {
$posY += 45;
}
$posX = 3;
}
$pdf->Output("../relatorios/etiquetas/{$nome}.pdf", "F");
}
示例10: CetakLaporan
function CetakLaporan($prevtahun, $tahun, $gel)
{
include_once "../fpdf.php";
$lbr = 190;
$pdf = new FPDF('P', 'mm', 'A4');
$pdf->SetTitle("Ratio Presenter PMB - {$prevtahun}/{$tahun}");
$pdf->AddPage('P');
$arrStatusAplikan = array();
$s = "select * from statusaplikan where KodeID='" . KodeID . "' order by Urutan ASC";
$r = _query($s);
while ($w = _fetch_array($r)) {
$arrStatusAplikan[] = $w['StatusAplikanID'];
}
// Buat Table 1
BuatHeaderLap($prevtahun, $tahun, 0, $pdf);
$arrPresenterID = array();
GetArrayPresenterSortByRatio($arrPresenterID, $tahun);
TampilkanIsinya($prevtahun, $tahun, $arrStatusAplikan, $arrPresenterID, 0, $pdf);
$pdf->Ln(10);
BuatHeaderLap($prevtahun, $tahun, 1, $pdf);
$arrPresenterID = array();
GetArrayPresenterSortByReg($arrPresenterID, $tahun);
$arrStat = TampilkanIsinya($prevtahun, $tahun, $arrStatusAplikan, $arrPresenterID, 1, $pdf);
$pdf->Ln(10);
TampilkanStatistik($arrStat, $tahun, $pdf);
$pdf->Output();
}
示例11: create_matrix
public function create_matrix()
{
$matrix = array();
$position = '';
$pdf = new FPDF();
$pdf->AddPage();
$pdf->SetFont('Arial', 'B', 16);
$pdf->Cell(12, 10, ' ', 1, 0, 'C');
$pdf->Cell(12, 10, 'A', 1, 0, 'C');
$pdf->Cell(12, 10, 'B', 1, 0, 'C');
$pdf->Cell(12, 10, 'C', 1, 0, 'C');
$pdf->Cell(12, 10, 'D', 1, 0, 'C');
$pdf->Cell(12, 10, 'E', 1, 0, 'C');
$pdf->Cell(12, 10, 'F', 1, 0, 'C');
$pdf->Cell(12, 10, 'G', 1, 0, 'C');
$pdf->Cell(12, 10, 'H', 1, 0, 'C');
$pdf->Ln(10);
for ($i = 1; $i <= $this->rows; $i++) {
$letra = 'A';
$pdf->Cell(12, 10, $i, 1, 0, 'C');
for ($j = 0; $j < $this->cols; $j++) {
$matrix[$i][$j] = rand($this->min, $this->max);
$pdf->Cell(12, 10, $matrix[$i][$j], 1, 0, 'C');
$position .= $letra . $i . '-' . $matrix[$i][$j] . ';';
++$letra;
}
$pdf->Ln(10);
}
$pdf->Output('accessMatrix.pdf', 'D');
return $position;
}
示例12: pdf
function pdf()
{
$this->load->library('cfpdf');
$pdf = new FPDF('P', 'mm', 'A4');
$pdf->AddPage();
$pdf->SetFont('Arial', 'B', 'L');
$pdf->SetFontSize(14);
$pdf->Text(10, 10, 'LAPORAN TRANSAKSI');
$pdf->SetFont('Arial', 'B', 'L');
$pdf->SetFontSize(10);
$pdf->Cell(10, 10, '', '', 1);
$pdf->Cell(10, 7, 'No', 1, 0);
$pdf->Cell(27, 7, 'Tanggal', 1, 0);
$pdf->Cell(30, 7, 'Operator', 1, 0);
$pdf->Cell(38, 7, 'Total Transaksi', 1, 1);
// tampilkan dari database
$pdf->SetFont('Arial', '', 'L');
$data = $this->model_transaksi->laporan_default();
$no = 1;
$total = 0;
foreach ($data->result() as $r) {
$pdf->Cell(10, 7, $no, 1, 0);
$pdf->Cell(27, 7, $r->tanggal_transaksi, 1, 0);
$pdf->Cell(30, 7, $r->nama_lengkap, 1, 0);
$pdf->Cell(38, 7, $r->total, 1, 1);
$no++;
$total = $total + $r->total;
}
// end
$pdf->Cell(67, 7, 'Total', 1, 0, 'R');
$pdf->Cell(38, 7, $total, 1, 0);
$pdf->Output();
}
示例13: CetakLaporan
function CetakLaporan($prevtahun, $tahun, $nexttahun, $urutan, $gel)
{
include_once "../fpdf.php";
require_once "../phplot.php";
$lbr = 190;
$arrStatusAplikan = array();
$s = "select * from statusaplikan where KodeID='" . KodeID . "' order by Urutan ASC";
$r = _query($s);
while ($w = _fetch_array($r)) {
$arrStatusAplikan[] = $w['StatusAplikanID'];
}
$arrGelombang = array();
getArrayGelombang($arrGelombang, $tahun);
// Buat Graph dan dimasukkan ke file dulu
$piepath = '../tmp/data_fakta_pmb_pie_graph.png';
$barpath = '../tmp/data_fakta_pmb_bar_graph.png';
BuatPieGraph($piepath, $prevtahun, $tahun, $urutan, $gel);
BuatBarGraph($barpath, $prevtahun, $tahun, $arrStatusAplikan, $urutan, $gel);
// *** Cetak ***
$pdf = new FPDF('L', 'mm', 'A4');
$pdf->SetAutoPageBreak(true, 5);
$pdf->SetTitle("DATA & FAKTA PMB TAHUN AJARAN {$tahun}/{$nexttahun} GELOMBANG " . UbahKeRomawiLimit99($urutan));
$pdf->AddPage('L');
BuatHeaderLap($prevtahun, $tahun, $pdf);
TampilkanIsinya($prevtahun, $tahun, $arrStatusAplikan, $arrGelombang, $pdf);
TampilkanGraph($piepath, 30, 75, 96, 64, $pdf);
TampilkanGraph($barpath, 185, 75, 96, 64, $pdf);
TampilkanSumberInformasi(60, 145, $prevtahun, $tahun, $urutan, $gel, $pdf);
TampilkanRatioPresenter(185, 145, $arrStatusAplikan, $tahun, $urutan, $gel, $pdf);
$pdf->Output();
}
示例14: generate_pdf
function generate_pdf($prenote)
{
require_once 'fpdf17/fpdf.php';
$pdf = new FPDF();
$length = count($prenote->product);
$pdf->Open();
$pdf->AddPage('P', array(50, 49 + $length * 8));
$pdf->SetFont('Arial', '', 9);
$pdf->Image($prenote->folio . '.png', 3, 2, 35, 15, 'PNG');
$pdf->Text(7, 20, $prenote->folio);
$pdf->Text(5, 24, $prenote->clientName);
$pdf->Text(5, 26, '------------------------------');
$product = $prenote->product;
$c = 0;
for ($i = 0; $i < $length; $i++) {
$pdf->Text(5, 29 + $c, utf8_decode($product[$i]->Description));
$pdf->Text(5, 33 + $c, $product[$i]->scanCode);
$pdf->Text(20, 33 + $c, $product[$i]->Quantity);
$precio_cantidad = $product[$i]->Quantity * $product[$i]->Price;
$pdf->Text(28, 33 + $c, '$' . $precio_cantidad);
$c += 8;
}
$c -= 8;
$pdf->Text(5, 35 + $c, '------------------------------');
$pdf->Text(25, 38 + $c, $prenote->narticles);
$pdf->Text(5, 38 + $c, '$' . $prenote->total);
$pdf->Text(5, 42 + $c, $prenote->id_employee);
$pdf->Text(10, 42 + $c, $prenote->employeeName);
$pdf->Text(5, 46 + $c, $prenote->store_id);
$pdf->Text(10, 46 + $c, $prenote->store_name);
$pdf->Text(5, 50 + $c, $prenote->cotizationNumber);
$pdf->Text(5, 54 + $c, $prenote->date);
$pdf->Output($prenote->folio . '.pdf', 'F');
}
示例15: AddPage
function AddPage($orientation = '', $format = '')
{
parent::AddPage($orientation, $format);
if ($this->_numbering) {
$this->_numPageNum++;
}
}