本文整理汇总了PHP中QRcode::displayFPDF方法的典型用法代码示例。如果您正苦于以下问题:PHP QRcode::displayFPDF方法的具体用法?PHP QRcode::displayFPDF怎么用?PHP QRcode::displayFPDF使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类QRcode
的用法示例。
在下文中一共展示了QRcode::displayFPDF方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: baking
// Size Font Item Name
//$pdf->Cell(96,$height*2,$data->m_item_name,1,0,'C'); // Item Name
$pdf->MultiCell(96, $height, $data->m_item_name, 0, 'C');
$pdf->SetXY(96 + 10, $height * 8 - 2);
$pdf->Cell(32, $height * 2, baking($data->m_item_baking), 1, 0, 'C');
// BAKING
$pdf->Ln($height * 2);
$pdf->SetFont($font, 'B', $size - 1);
$pdf->Cell(25, $height, 'No. COIL', 1, 0, 'L');
$pdf->Cell(39, $height, '', 1, 0, 'C');
$pdf->SetFont($font, '', $size * 0.75);
$pdf->Cell(32, $height * 2, $data->t_prod_id, 1, 0, 'C');
//ID Kartu
$qrcode = new QRcode($data->t_prod_id, 'H');
// error level : L, M, Q, H
$qrcode->displayFPDF($pdf, 115, 68, 14);
$pdf->Cell(32, $height * 2, '', 1, 0, 'C');
//bARCODE
$pdf->Ln($height);
$pdf->SetFont($font, 'B', $size - 1);
$pdf->Cell(25, $height, 'TYPE WIRE', 1, 0, 'L');
$pdf->SetFont($font, '', $size);
$pdf->Cell(39, $height, $data->m_item_bom_name, 1, 0, 'C');
// Tipe Wire
$pdf->Ln($height);
$pdf->SetFont($font, 'B', $size - 1);
$pdf->Cell(32, $height, 'TOTAL WIRE(Kg)', 1, 0, 'L');
$pdf->SetFont($font, '', $size);
$pdf->Cell(32, $height, number_format(round_up($data->t_po_detail_prod * $data->m_bom_qty / 1000, 2), 0, ',', '.'), 1, 0, 'C');
// Total Wire
$pdf->SetFont($font, 'B', $size - 1);
示例2: qrcode
protected function qrcode()
{
$qr = new \QRcode($this->entity->getUrl(), 'L');
$qr->disableBorder();
$w = 17;
$x = $this->xPos + self::$WIDTH - 1 - $w;
$y = $this->yPos + self::$HEIGHT - 3 - $w;
$qr->displayFPDF($this->pdf, $x, $y, $w);
}
示例3: dirname
/**
* balise : QRCODE
* mode : OUVERTURE
*
* @param array paramètres de l'élément de parsing
* @return null
*/
function o_QRCODE($param)
{
if ($this->DEBUG_actif) {
$this->DEBUG_add('QRCODE', true);
}
if (!isset($param['value'])) {
$param['value'] = '';
}
if (!isset($param['ec'])) {
$param['ec'] = 'H';
}
if (!isset($param['size'])) {
$param['size'] = '0.6mm';
}
if (!isset($param['style']['color'])) {
$param['style']['color'] = '#000000';
}
if (!isset($param['style']['background-color'])) {
$param['style']['background-color'] = '#FFFFFF';
}
if ($param['value'] === '') {
return true;
}
$this->style->save();
$this->style->analyse('qrcode', $param);
$this->style->setPosition($this->pdf->x, $this->pdf->y);
$this->style->FontSet();
$x = $this->pdf->getX();
$y = $this->pdf->getY();
$s = $this->style->ConvertToMM($param['size']);
$ec = $param['ec'];
if (!in_array($ec, array('L', 'M', 'Q', 'H'))) {
$ec = 'H';
}
$color = $this->style->value['color'];
$background = $this->style->value['background']['color'];
require_once dirname(__FILE__) . '/qrcode/qrcode.class.php';
$qrcode = new QRcode($param['value'], $ec);
$size = $s * $qrcode->getQrSize();
if (!$this->sub_part && !$this->isSubPart) {
$qrcode->displayFPDF($this->pdf, $x, $y, $s, $background, $color);
}
unset($qrcode);
// position maximale globale
$this->maxX = max($this->maxX, $x + $size);
$this->maxY = max($this->maxY, $y + $size);
$this->maxH = max($this->maxH, $size);
$this->pdf->setX($x + $size);
$this->style->load();
$this->style->FontSet();
return true;
}
示例4: pQRDANFE
protected function pQRDANFE($x = 0, $y = 0, $h = 0)
{
// CONFIGURAÇÃO DE POSIÇÃO
$margemInterna = $this->margemInterna;
$maxW = $this->wPrint;
$w = $maxW * 1;
$hLinha = $this->hLinha;
$hBoxLinha = $this->hBoxLinha;
$aFontTit = array('font' => $this->fontePadrao, 'size' => 8, 'style' => 'B');
$aFontTex = array('font' => $this->fontePadrao, 'size' => 8, 'style' => '');
$dhRecbto = '';
$nProt = '';
if (isset($this->nfeProc)) {
$nProt = $this->pSimpleGetValue($this->nfeProc, "nProt");
$dhRecbto = $this->pSimpleGetValue($this->nfeProc, "dhRecbto");
}
$qrcode = new QRcode($this->qrCode, 'M');
$wQr = 50;
$hQr = 50;
$yQr = $y + $margemInterna;
$xQr = $w / 2 - $wQr / 2;
$qrcode->displayFPDF($this->pdf, $xQr, $yQr, $wQr);
$yQr = $yQr + $hQr + $margemInterna;
$this->pTextBox($x, $yQr, $w, $hBoxLinha, "Protocolo de Autorização: " . $nProt . "\n" . $dhRecbto, $aFontTex, 'C', 'C', 0, '', false);
}
示例5: generate_pdf
/**
* Generate and save or stream a PDF file for this product voucher
*
* @since 1.0
* @param string $path optional absolute path to the voucher directory, if
* not supplied the PDF will be streamed as a downloadable file (used
* for admin previewing of the PDF)
*
* @return mixed nothing if a $path is supplied, otherwise a PDF download
* @throws Exception if the voucher image is not available
*/
public function generate_pdf($path = '')
{
// include the pdf library
define('FPDF_FONTPATH', wc_pdf_product_vouchers()->get_plugin_path() . '/lib/fpdf/font');
require_once wc_pdf_product_vouchers()->get_plugin_path() . '/lib/fpdf/fpdf.php';
$upload_dir = wp_upload_dir();
$image = wp_get_attachment_metadata($this->get_image_id());
// make sure the image hasn't been deleted through the media editor
if (!$image) {
throw new Exception(__("Voucher image not found", WC_PDF_Product_Vouchers::TEXT_DOMAIN));
}
// make sure the file exists and is readable
if (!is_readable($upload_dir['basedir'] . '/' . $image['file'])) {
throw new Exception(sprintf(__("Voucher image file missing or not readable: %s", WC_PDF_Product_Vouchers::TEXT_DOMAIN), $upload_dir['basedir'] . '/' . $image['file']));
}
// determine orientation: landscape or portrait
if ($image['width'] > $image['height']) {
$orientation = 'L';
} else {
$orientation = "P";
}
// get the width and height in points
$width_pt = $this->convert_pixels_to_points($image['width']);
$height_pt = $this->convert_pixels_to_points($image['height']);
// Create the pdf
// When writing text to a Cell, the text is vertically-aligned in the middle
$fpdf = new FPDF($orientation, 'pt', array($width_pt, $height_pt));
$fpdf->AddPage();
$fpdf->SetAutoPageBreak(false);
// set the voucher image
$fpdf->Image($upload_dir['basedir'] . '/' . $image['file'], 0, 0, $width_pt, $height_pt);
// this is useful for displaying the text cell borders when debugging the PDF layout,
// though keep in mind that we translate the box position to align the text to bottom
// edge of what the user selected, so if you want to see the originally selected box,
// display that prior to the translation
$show_border = 0;
foreach ($this->voucher_fields as $field_name => $field) {
switch ($field_name) {
case 'message':
// voucher message text, this is multi-line, so it's handled specially
$this->textarea_field($fpdf, 'message', $this->get_message(), $show_border, isset($field['text_align']) && $field['text_align'] ? $field['text_align'] : $this->voucher_text_align);
break;
case 'product_name':
// product name (allow optional wrapping)
if (apply_filters('wc_pdf_product_vouchers_product_name_multi_line', false, $this)) {
$this->textarea_field($fpdf, 'product_name', strtoupper($this->get_product_name()), $show_border, isset($field['text_align']) && $field['text_align'] ? $field['text_align'] : $this->voucher_text_align);
} else {
$this->text_field($fpdf, 'product_name', strtoupper($this->get_product_name()), $show_border, isset($field['text_align']) && $field['text_align'] ? $field['text_align'] : $this->voucher_text_align);
}
break;
case 'product_sku':
// product sku
$this->text_field($fpdf, 'product_sku', $this->get_product_sku(), $show_border, isset($field['text_align']) && $field['text_align'] ? $field['text_align'] : $this->voucher_text_align);
break;
case 'recipient_name':
// recepient name
$this->text_field($fpdf, 'recipient_name', $this->get_recipient_name(), $show_border, isset($field['text_align']) && $field['text_align'] ? $field['text_align'] : $this->voucher_text_align);
break;
case 'recipient_email':
// recepient email
$this->text_field($fpdf, 'recipient_email', $this->get_recipient_email(), $show_border, isset($field['text_align']) && $field['text_align'] ? $field['text_align'] : $this->voucher_text_align);
break;
case 'expiration_date':
// expiry date
$this->text_field($fpdf, 'expiration_date', $this->get_formatted_expiration_date(), $show_border, isset($field['text_align']) && $field['text_align'] ? $field['text_align'] : $this->voucher_text_align);
break;
case 'voucher_number':
// voucher number
$this->text_field($fpdf, 'voucher_number', $this->get_voucher_number(), $show_border, isset($field['text_align']) && $field['text_align'] ? $field['text_align'] : $this->voucher_text_align);
break;
case 'voucher_product_price':
// voucher number
$this->text_field($fpdf, 'voucher_product_price', $this->wc_price($this->get_product_price()), $show_border, isset($field['text_align']) && $field['text_align'] ? $field['text_align'] : $this->voucher_text_align);
break;
case 'qr-code':
case 'qrcode':
case 'qr':
// Voucher QR-code
require_once wc_pdf_product_vouchers()->get_plugin_path() . '/lib/fpdf/qrcode/qrcode.class.php';
$qrcode = new QRcode(str_replace("{X}", $this->get_voucher_number(), $this->voucher_fields[strtolower($this->{$field_name})]["label"]), 'L');
// error level : L, M, Q, H
$qrcode->disableBorder();
//header("Content-type: text/plain");
//print_r($this->voucher_fields[strtolower($this->$field_name)]["position"]["color"]);
//exit();
//$qrcode->displayPNG();
//exit();
$qrcode->displayFPDF($fpdf, $this->voucher_fields[strtolower($this->{$field_name})]["position"]["x"], $this->voucher_fields[strtolower($this->{$field_name})]["position"]["y"], $this->voucher_fields[strtolower($this->{$field_name})]["position"]["width"], $this->voucher_fields[strtolower($this->{$field_name})]["position"]["background"], $this->voucher_fields[strtolower($this->{$field_name})]["position"]["color"]);
break;
//.........这里部分代码省略.........
示例6: array
/**
* balise : QRCODE
* mode : OUVERTURE
*
* @param array paramètres de l'élément de parsing
* @return null
*/
function o_QRCODE($param)
{
if ($this->testIsDeprecated && (isset($param['size']) || isset($param['noborder']))) {
HTML2PDF::makeError(9, __FILE__, __LINE__, array('QRCODE', 'size, noborder'));
}
$msg = '
<h1>QRCODE Tag</h1>
<pre>
<b>ATTENTION :</b>
Vous devez télécharger la librairie "QR-code generator >=0.99" (sous licence LGPL)
a cette adresse : <a href="http://prgm.spipu.net/php_qrcode" target="_blank">http://prgm.spipu.net/php_qrcode</a>
et mettre tout son contenu dans ce repertoire : ' . str_replace('\\', '/', dirname(__FILE__)) . '/qrcode
<b>WARNING:</b>
You have to download the librairy "QR-code generator >=0.99" (under LGPL licence)
at this url : <a href="http://prgm.spipu.net/php_qrcode" target="_blank">http://prgm.spipu.net/php_qrcode</a>
and to put all his contents in this folder ' . str_replace('\\', '/', dirname(__FILE__)) . '/qrcode
</pre>';
$file_class = dirname(__FILE__) . '/qrcode/qrcode.class.php';
if (!is_file($file_class)) {
echo $msg;
exit;
}
require_once $file_class;
if (__CLASS_QRCODE__ < '0.99') {
echo $msg;
exit;
}
if ($this->DEBUG_actif) {
$this->DEBUG_add('QRCODE', true);
}
if (!isset($param['value'])) {
$param['value'] = '';
}
if (!isset($param['ec'])) {
$param['ec'] = 'H';
}
if (!isset($param['style']['color'])) {
$param['style']['color'] = '#000000';
}
if (!isset($param['style']['background-color'])) {
$param['style']['background-color'] = '#FFFFFF';
}
if (isset($param['style']['border'])) {
$borders = $param['style']['border'] != 'none';
unset($param['style']['border']);
} else {
$borders = true;
}
if ($param['value'] === '') {
return true;
}
if (!in_array($param['ec'], array('L', 'M', 'Q', 'H'))) {
$param['ec'] = 'H';
}
$this->style->save();
$this->style->analyse('qrcode', $param);
$this->style->setPosition();
$this->style->FontSet();
$x = $this->pdf->getX();
$y = $this->pdf->getY();
$w = $this->style->value['width'];
$h = $this->style->value['height'];
$size = max($w, $h);
if (!$size) {
$size = $this->style->ConvertToMM('50mm');
}
$color = $this->style->value['color'];
if (count($color) == 4) {
$color = array(0, 0, 0);
}
$color[0] = floor($color[0] * 255.0);
$color[1] = floor($color[1] * 255.0);
$color[2] = floor($color[2] * 255.0);
$background = $this->style->value['background']['color'];
if (count($background) == 4) {
$background = array(0, 0, 0);
}
$background[0] = floor($background[0] * 255.0);
$background[1] = floor($background[1] * 255.0);
$background[2] = floor($background[2] * 255.0);
if (!$this->sub_part && !$this->isSubPart) {
$qrcode = new QRcode($param['value'], $param['ec']);
if (!$borders) {
$qrcode->disableBorder();
}
$qrcode->displayFPDF($this->pdf, $x, $y, $size, $background, $color);
unset($qrcode);
}
// position maximale globale
$this->maxX = max($this->maxX, $x + $size);
$this->maxY = max($this->maxY, $y + $size);
$this->maxH = max($this->maxH, $size);
//.........这里部分代码省略.........
示例7: isset
<?php
$msg = isset($_GET['msg']) ? $_GET['msg'] : '';
if (!$msg) {
$msg = "";
}
$err = isset($_GET['err']) ? $_GET['err'] : '';
if (!in_array($err, array('L', 'M', 'Q', 'H'))) {
$err = 'L';
}
require_once 'qrcode.class.php';
$qrcode = new QRcode(utf8_encode($msg), $err);
# $qrcode->disableBorder();
$qrcode->displayPNG(300);
$qrcode->displayFPDF($fpdf, $x, $y, $w, $background, $color);
示例8: Footer
//.........这里部分代码省略.........
$this->SetXY(43, 200);
$this->SetDrawColor(255, 255, 255);
$this->SetFillColor(225, 225, 225);
$this->SetTextColor(191, 81, 80);
$this->SetLineWidth(0);
$this->Cell(215.5, 5, 'Sello Digital del CFDI:', 1, 1, 'L', true);
$this->Ln(10);
//Colonia
$this->SetFont('Arial', '', 8);
$this->SetXY(45, 205);
$this->SetDrawColor(255, 255, 255);
$this->SetFillColor(255, 255, 255);
$this->SetTextColor(0, 0, 0);
$this->SetLineWidth(0);
$this->MultiCell(0, 4, @$data['sellocfd'], 0, 'T', 'C', true);
//RFC
$this->Ln(10);
$this->SetFont('Arial', 'B', 9);
$this->SetXY(43, 215);
$this->SetDrawColor(255, 255, 255);
$this->SetFillColor(225, 225, 225);
$this->SetTextColor(191, 81, 80);
$this->SetLineWidth(0);
$this->Cell(215.5, 5, 'Sello SAT:', 1, 1, 'L', true);
$this->Ln(10);
//Colonia
$this->SetFont('Arial', '', 8);
$this->SetXY(45, 220);
$this->SetDrawColor(255, 255, 255);
$this->SetFillColor(255, 255, 255);
$this->SetTextColor(0, 0, 0);
$this->SetLineWidth(0);
$this->MultiCell(0, 4, @$data['sellocfd'], 0, 'T', 'C', true);
//RFC
$this->Ln(10);
$this->SetFont('Arial', 'B', 9);
$this->SetXY(43, 230);
$this->SetDrawColor(255, 255, 255);
$this->SetFillColor(225, 225, 225);
$this->SetTextColor(191, 81, 80);
$this->SetLineWidth(0);
$this->Cell(215.5, 5, utf8_decode('Cadena Original del complemento de certificación digital del SAT:'), 1, 1, 'L', true);
$this->Ln(10);
$original = "||1.0|9B090610-3F15-417A-A1B0-6CF83939DA53|2015-02-08T11:23:40|KnjqSjLIt4M/BM6GgqgXn/IitYnrP6jP3843o5zFTl47C53daZd279Wx42WcyKYpD1G3cnOEcBQpn8khSdFwMLFSaqVIS/Olu4KlgtR5Ii70yXfDB/6Pzx1GHL7kjYAjHa8Les3GQGaBpZQMs1UM6aL8zkh7IVrUIZplAZEGbNA=|00001000000202865018||";
//Colonia
$this->SetFont('Arial', '', 8);
$this->SetXY(45, 235);
$this->SetDrawColor(255, 255, 255);
$this->SetFillColor(255, 255, 255);
$this->SetTextColor(0, 0, 0);
$this->SetLineWidth(0);
$this->MultiCell(0, 4, "{$original}", 0, 'T', 'C', true);
//RFC
$this->Ln(10);
$this->SetFont('Arial', 'B', 9);
$this->SetXY(0, 250);
$this->SetDrawColor(255, 255, 255);
$this->SetFillColor(225, 225, 225);
$this->SetTextColor(191, 81, 80);
$this->SetLineWidth(0);
$this->Cell(215.5, 5, utf8_decode('Este documento es una representación impresa de un cfdi'), 1, 1, 'C', false);
$this->Ln(10);
$qrcode = new QRcode($original, 'L');
// error level : L, M, Q, H
$qrcode->displayFPDF($this, 1, 205, 40);
//RECEPTOR
$this->SetDrawColor(191, 81, 80);
$this->SetLineWidth(1);
$this->Line(1, 200, 215, 200);
// Información del receptor
//RECEPTOR
$this->SetDrawColor(191, 81, 80);
$this->SetLineWidth(1);
$this->Line(1, 258, 215, 258);
//Colonia
$this->SetFont('Arial', 'B', 6);
$this->SetXY(0, 260);
$this->SetDrawColor(255, 255, 255);
$this->SetFillColor(255, 255, 255);
$this->SetTextColor(0, 0, 0);
$this->SetLineWidth(0);
$this->Cell(0, 4, "HERRAMIENTASCONTABLES.COM | CUITLAHUAC NO. 537 INT. 12 | COL. ANALCO | GUADALAJARA, JALISCO | MEXICO", 1, 1, 'C', true);
//RFC
$this->Ln(10);
//Colonia
$this->SetFont('Arial', 'B', 6);
$this->SetXY(0, 263);
$this->SetDrawColor(255, 255, 255);
$this->SetFillColor(255, 255, 255);
$this->SetTextColor(0, 0, 0);
$this->SetLineWidth(0);
$this->Cell(0, 4, "TEL. (33) 12 10 1985 | E-MAIL: CONTACTO@HERRAMIENTASCONTABLES.COM", 1, 1, 'C', true);
//RFC
$this->Ln(10);
// Pie de página
$this->SetY(-15);
$this->SetFont('Arial', 'I', 8);
$this->SetTextColor(128);
$this->Cell(0, 10, utf8_decode('Página ' . $this->PageNo()), 0, 0, 'C');
}