本文整理汇总了PHP中FPDF::Image方法的典型用法代码示例。如果您正苦于以下问题:PHP FPDF::Image方法的具体用法?PHP FPDF::Image怎么用?PHP FPDF::Image使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类FPDF
的用法示例。
在下文中一共展示了FPDF::Image方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: download
public function download($page = 'noticeview')
{
define('FPDF_FONTPATH', APPPATH . 'plugins/fpdf/font/');
require APPPATH . 'plugins/fpdf/fpdf.php';
$this->load->helper('url');
if (!file_exists(APPPATH . '/views/noticeboard/' . $page . '.php')) {
show_404();
}
$data['title'] = ucfirst($page);
// Capitalize the first letter
$data['name'] = "Nayeem";
$id = $_GET['id'];
$file = base_url() . 'uploads/' . $id . '.jpg';
$type = ".jpg";
if (@getimagesize($file)) {
$size = getimagesize($file);
} else {
$type = ".png";
$file = base_url() . 'uploads/' . $id . '.png';
$size = getimagesize(base_url() . 'uploads/' . $id . '.png');
}
//$pdf = new FPDF('p','mm',array(210,300));
if ($size[0] > $size[1]) {
$style = 'l';
} else {
$style = 'p';
}
$pdf = new FPDF($style, 'pt', array($size[0] * 3 / 4, $size[1] * 3 / 4));
$pdf->AddPage();
$pdf->setDisplayMode('fullpage');
//$pdf -> Image(base_url().'uploads/'.$id.'.png',20,20,170,260);
$pdf->Image(base_url() . 'uploads/' . $id . "" . $type, 0, 0, 0, 0);
// $pdf -> setFont ('times','B',20);
// $pdf -> cell(200,30,"Title",0,1);
$pdf->setFont('times', 'B', '20');
$pdf->write(10, "{$size['0']}, {$size['1']}");
$pdf->output($id . '.pdf', 'D');
//header('Location: ' .base_url(). 'index.php/noticeview/show?id='.$id);
}
示例2: FPDF
$name = $_POST['name'];
$characteristics = $_POST['characteristics'];
$image = $_POST['image'];
require 'fpdf17/fpdf.php';
//create a FPDF object
$pdf = new FPDF();
//set document properties
$pdf->SetAuthor('Anon');
$pdf->SetTitle($name);
//set font for the entire document
$pdf->SetFont('Helvetica', 'B', 20);
$pdf->SetTextColor(50, 60, 100);
//set up a page
$pdf->AddPage('P');
//$pdf->SetDisplayMode(real,'default');
//insert an image and make it a link
$pdf->Image('logo.png', 10, 20, 33, 0);
//display the title without a border around it
$pdf->SetXY(50, 20);
$pdf->SetDrawColor(50, 60, 100);
$pdf->Cell(100, 10, $name, 0, 0, 'C', 0);
// Insert a dynamic image from a URL
$pdf->Image($image, 75, 30, 0, 50);
//Set x and y position for the main text, reduce font size and write content
$pdf->SetXY(10, 90);
$pdf->SetFontSize(10);
$pdf->Write(5, $characteristics);
//Output the document
$pdf->Output();
?>
示例3: FPDF
$pdf->SetY(80);
$pdf->Cell(10, 10, 'No hay informacion');
}
}
$pdf->Output();
break;
case 'ver_detalle':
// Creamos el PDF
//Creación del objeto de la clase heredada
$pdf = new FPDF();
$pdf->AliasNbPages();
//Primera página
$pdf->AddPage();
$id_ticket = $_GET['id_ticket'];
// Imagen de encabezado
$pdf->Image("./images/banner4.jpg", 10, 0, 180, 40, "JPG", "");
// Titulo del Reporte
$pdf->SetFont('Arial', 'B', 20);
$pdf->SetY(45);
$pdf->Cell(50, 10, 'Detalle del Ticket No. ' . $id_ticket);
// Configuracion de colores
$pdf->SetY(60);
$pdf->SetFillColor(224, 235, 255);
$pdf->SetTextColor(0);
$pdf->SetDrawColor(128, 0, 0);
$pdf->SetLineWidth(0.3);
$pdf->SetFont('', 'B');
if ($result = $obj_modelo->GetDetalleTicket($id_ticket)) {
if ($obj_conexion->GetNumberRows($result) > 0) {
// Establecemos la cabecera de la tabla
$pdf->SetFont('Arial', 'B', 10);
示例4: generarPdf
function generarPdf($num)
{
$pdf = new FPDF('P');
$pdf->AddPage();
$pdf->Image('../../../public_html/imagenes/logoclaro.png', 40, 50, 120);
$pdf->SetTitle("Notificación al denunciante", true);
$pdf->Image('../../../public_html/imagenes/logoivss.png', 20, 7, 13);
$pdf->SetFont('Arial', '', 6);
//$pdf->Text(40,10,utf8_decode('hola'));
//$nombre = "Prob".date('m-d-Y').".pdf";
$pdf->Output("Prob{$num}.pdf", 'F');
}
示例5: 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');
}
示例6: CreatePDFRendering
private function CreatePDFRendering($name, $company, $file)
{
$pdf = new FPDF('L', 'pt', array(162, 288));
//2.25"x4"
$pdf->AddPage();
$pdf->SetFont('Arial', 'B', 22);
//name font style
$pdf->Cell(0, 22, $name, 0, 1, 'C');
//name
$pdf->Cell(0, 10, '', 0, 1, 'C');
//blank line
$pdf->SetFont('Arial', 'I', 16);
//company font style
$pdf->Cell(0, 16, $company, 0, 1, 'C');
//company name
$pdf->Cell(0, 28, '', 0, 1, 'C');
//blank line
$pdf->Image('images/logo.png', $pdf->GetX() + 165, $pdf->GetY(), 65);
if ($file == true) {
//set file name to hash of object
$fullpath = $this->savedirectory . md5(spl_object_hash($pdf)) . '.pdf';
$pdf->Output($fullpath, 'F');
$pdf->Close();
$cmd = 'lpr ' . $fullpath;
$cmdout = shell_exec($cmd);
return $fullpath;
} else {
return $pdf->Output();
}
}
示例7: 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");
}
示例8: Image
public function Image($file, $x = null, $y = null, $w = 0, $h = 0, $type = '', $link = '')
{
if (!isset($this->images[$file])) {
//Retrieve only meta-information
$a = getimagesize($file);
if ($a === false) {
$this->Error('Missing or incorrect image file: ' . $file);
}
$this->images[$file] = array('w' => $a[0], 'h' => $a[1], 'type' => $a[2], 'i' => count($this->images) + 1);
}
parent::Image($file, $x, $y, $w, $h, $type, $link);
}
示例9: getPdf
function getPdf($image)
{
require JPATH_SITE . "/components/com_flexpaper/fpdf/fpdf.php";
$filePath = JPATH_SITE . "/components/com_flexpaper/output/certificate.pdf";
$pdf = new FPDF('L', 'mm');
$pdf->SetLeftMargin(0);
$pdf->SetRightMargin(0);
$pdf->SetTopMargin(0);
$pdf->SetAutoPageBreak(false);
$pdf->AddPage();
$pdf->Image($image);
$pdf_file = $pdf->Output($filePath, 'F');
return $pdf_file;
}
示例10: Header
function Header()
{
parent::SetFont($this->getFont(), '', 18);
$this->SetTextColor(255, 255, 255);
$this->SetFillColor($this->colorBackg[0], $this->colorBackg[1], $this->colorBackg[2]);
//Título
$tam = $this->w - 3;
$pX = ($this->w - $tam) / 2;
$this->SetX($pX);
parent::Cell($tam, 15, $this->getTitle(), 0, 0, 'R', true);
if ($this->getLogoHeader() != "") {
parent::Image($this->getLogoHeader(), $pX, 11, 40);
}
//Salto de línea
parent::Ln(20);
parent::SetFont($this->getFont(), '', 10);
}
示例11: FPDF
function generate_news_pdf($news)
{
$imagePath = $_SERVER['DOCUMENT_ROOT'] . 'news_app/uploads/news_images/';
require $_SERVER['DOCUMENT_ROOT'] . 'news_app/app/libraries/FPDF/fpdf.php';
$pdf = new FPDF();
$pdf->AliasNbPages();
$pdf->AddPage();
$pdf->SetFont('Arial', 'B', 16);
// Title
//$pdf->Ln(4);
$pdf->Write(1, $news->title);
//$pdf->Ln(10);
$pdf->Image($imagePath . $news->news_image, 50, 30, 'C');
//$pdf->Ln(16);
$pdf->SetFont('Arial', '', 12);
$pdf->Write(5, $news->news_text);
$pdf->Output();
}
示例12: create_pdf
function create_pdf()
{
define('FPDF_FONTPATH', 'font/');
require 'fpdf.php';
$unique_id = $_GET['unq'];
$invoid = $_POST['invoid'];
// post the form in page 2
$invonm = $_POST['invonm'];
// name
$invopc = $_POST['invopc'];
// postcode
$invoad = $_POST['invoad'];
// address
$invoem = $_POST['invoem'];
// email
$invoph = $_POST['invoph'];
// telephone
$invoss = $_POST['invoss'];
// services
$invotl = $_POST['invotl'];
// total
$invode = $_POST['invode'];
// date
$invost = $_POST['invost'];
// unique stamp
// $invid = $_SESSION['invoice_id'];
// $invnm = $_SESSION['invoice_name'];
// $invad = $_SESSION['invoice_address'];
// $invem = $_SESSION['invoice_email'];
// $invpc = $_SESSION['invoice_postcode'];
$pdf = new FPDF();
$pdf->AddPage();
$pdf->Image('img/logo.jpg');
$pdf->SetFont('Arial', '', '12');
$pdf->Cell(0, -6, 'Invoice date: ' . $invode, 0, 1, "R");
$pdf->Cell(0, -6, 'UIS: ' . $invost, 0, 1, "R");
$pdf->Cell(0, 24, '', 0, 1, "L");
$pdf->Cell(0, 6, 'Customer Name: ' . $invonm, 0, 1, "L");
$pdf->Cell(0, 6, 'Address: ' . $invoad, 0, 1, "L");
$pdf->Cell(0, 6, 'Postcode: ' . $invopc, 0, 1, "L");
$pdf->Cell(0, 6, 'Telephone: ' . $invoph, 0, 1, "L");
$pdf->Output();
}
示例13: get_receipt
public function get_receipt($transaction_id)
{
$this->load->library('fpdf');
$transaction_details = $this->get_transaction($transaction_id);
$this->load->model('User_model');
$this->User_model->initialize($transaction_details['user_id']);
$user_details = $this->User_model->get('*');
//lookup profile
$profile_details = $this->get_profile($transaction_details['profile_id'], 'billingperiod, amount, taxamt');
//lookup subscription
$subscription_details = $this->get_subscription_by_transaction($transaction_id);
$pdf = new FPDF('P', 'mm', 'Letter');
$pdf->AddPage();
$pdf->SetAuthor('ESCTT Inc.');
$pdf->SetTitle('Invoice');
$pdf->Image('http://v1.riskmp.com/assets/images/logo.png', 10, 10, 35, 19, '', 'http://v1.riskmp.com/');
$pdf->SetXY(50, 10);
$pdf->SetFont('Arial', 'B', 40);
$pdf->Cell(100, 20, 'Receipt');
$address_x = $pdf->GetX();
$pdf->set_field_title_font($pdf);
$pdf->Write(14, 'ESCTT Inc.');
$pdf->Ln(5);
$pdf->SetX($address_x);
$pdf->Write(14, '131 Bloor Street West');
$pdf->Ln(5);
$pdf->SetX($address_x);
$pdf->Write(14, 'Suite 200/318');
$pdf->Ln(5);
$pdf->SetX($address_x);
$pdf->Write(14, 'Toronto, ON M5S 1R8');
$pdf->Ln(5);
$pdf->SetX($address_x);
$pdf->Write(14, 'Business # ' . BUSINESS_NUMBER);
$pdf->SetXY(10, 40);
$pdf->set_field_title_font($pdf);
$pdf->Write(10, 'Client: ');
$pdf->set_field_value_font($pdf);
$pdf->Write(10, $user_details['first_name'] . " " . $user_details['last_name']);
$pdf->set_field_title_font($pdf);
$pdf->SetX(140);
$pdf->Write(10, 'Generated on: ');
$pdf->set_field_value_font($pdf);
$pdf->Write(10, date("Y-m-d"));
$pdf->Ln(16);
$pdf->SetFont('Arial', 'B', 18);
$pdf->Write(6, 'Transaction Details');
$pdf->Ln(6);
$pdf->set_field_title_font($pdf);
$pdf->Write(14, 'Transaction ID: ');
$pdf->set_field_value_font($pdf);
$pdf->Write(14, $transaction_id);
$pdf->Ln(7);
$pdf->set_field_title_font($pdf);
$pdf->Write(14, 'Order Time: ');
$pdf->set_field_value_font($pdf);
$pdf->Write(14, $transaction_details['order_time']);
$pdf->Ln(7);
$pdf->set_field_title_font($pdf);
$pdf->Write(14, 'Payment Method: ');
$pdf->set_field_value_font($pdf);
$pdf->Write(14, 'Credit Card');
$pdf->Ln(16);
$pdf->SetFont('Arial', 'B', 18);
$pdf->Write(6, 'Purchase Details');
$pdf->Ln(4);
//set table header and body fonts
$thfont = array('family' => 'Arial', 'style' => 'B', 'size' => 11);
$tbfont = array('family' => 'Arial', 'style' => '', 'size' => 11);
$pdf->Ln(4);
$twidth = array(150, 50);
//column widths
$theader = array('Item', 'Amount');
//column titles
$tdata = array(array('RiskMP Membership @ 1 ' . $profile_details['billingperiod'], '$' . $profile_details['amount']), array('Tax', '$' . $profile_details['taxamt']), array('Grand Total', '$' . number_format(floatval($profile_details['amount']) + floatval($profile_details['taxamt']), 2, '.', '')));
$pdf->create_table($theader, $tdata, $twidth, 'L', 'L', $thfont, $tbfont);
//add table to pdf document
$pdf->set_field_title_font($pdf);
$pdf->Write(14, 'Subscription Start Date: ');
$pdf->set_field_value_font($pdf);
$pdf->Write(14, $subscription_details['date_of_redemption']);
$pdf->Ln(7);
$pdf->set_field_title_font($pdf);
$pdf->Write(14, 'Subscription Expiry Date: ');
$pdf->set_field_value_font($pdf);
$pdf->Write(14, $subscription_details['expiry_date']);
return $pdf;
}
示例14:
$pdf->Ln(5);
$pdf->SetFont('Arial', 'B', 12);
$pdf->Cell(189, 10, $row['endereco'], L, 0, 'L');
$pdf->Cell(1, 10, '', R, 0, 'L');
$pdf->Ln(9);
$pdf->Cell(190, 1, '', B, 0, 'L');
$pdf->SetFont('Arial', 'B', 9);
$pdf->Ln(1);
$pdf->Cell(20, 10, 'Parcela', 1, 0, 'C');
$pdf->Cell(25, 10, 'Data Venc.', 1, 0, 'C');
$pdf->Cell(25, 10, 'Valor Da Parc.', 1, 0, 'C');
$pdf->Cell(25, 10, 'Multa', 1, 0, 'C');
$pdf->Cell(25, 10, 'Juros', 1, 0, 'C');
$pdf->Cell(30, 10, 'Desconto', 1, 0, 'C');
$pdf->Cell(40, 10, 'Total', 1, 0, 'C');
$pdf->SetFont('Arial', '', 9);
$pdf->Ln(10);
$pdf->Cell(20, 10, '0', 0, 0, 'C');
$pdf->Cell(25, 10, '06/04/2015', 0, 0, 'C');
$pdf->Cell(25, 10, 'R$ 512,00', 0, 0, 'C');
$pdf->Cell(25, 10, 'R$ 0,00', 0, 0, 'C');
$pdf->Cell(25, 10, 'R$ 0,00', 0, 0, 'C');
$pdf->Cell(30, 10, 'R$ 12,00', 0, 0, 'C');
$pdf->Cell(40, 10, 'R$ 500,00', 0, 0, 'C');
$pdf->Ln(10);
$pdf->Ln(85);
$pdf->Image('../fpdf/img/barras.png', 10, 180, 110);
$pdf->Cell(190, 1, '', B, 0, 'L');
$pdf->Image('../fpdf/img/corpo.png', 10, 200, 190, 70);
$pdf->Image('../fpdf/img/barras.png', 10, 270, 110);
$pdf->Output();
示例15: FPDF
$study_type = "zao";
}
$pdf = new FPDF();
//set document properties
$pdf->SetAuthor('Alexandr Slovinskiy');
$pdf->SetTitle('Order Annex');
//set font for the entire document
$pdf->AddFont('Times', '', 'times.php');
$pdf->SetFont('Times', '');
$pdf->SetTextColor(0, 0, 0);
//set up a page
$pdf->AddPage('L');
$pdf->SetDisplayMode(real, 'default');
//display the title with a border around it
//Set x and y position for the main text, reduce font size and write content
$pdf->Image('img/form_1-12-2.jpg', 10, 15, 280);
$pdf->SetFontSize(9);
$pdf->SetXY(261, 29.5);
$pdf->Write(5, $_POST["order_number"]);
$pdf->SetXY(197.5, 37);
$pdf->Write(5, $_POST["day"]);
$pdf->SetXY(205, 37);
$pdf->Write(5, $_POST["month"]);
$pdf->SetXY(225.4, 37);
$pdf->Write(5, substr($_POST["year"], 2, 2));
$pdf->SetXY(196, 63);
if ($_POST["search_finance"] == 'b') {
$pdf->Write(5, "за державним замовленням");
}
if ($_POST["search_finance"] == 'c') {
$pdf->Write(5, "за рахунок коштів фізичних, юридичних осіб");