本文整理汇总了PHP中TCPDF::write1DBarcode方法的典型用法代码示例。如果您正苦于以下问题:PHP TCPDF::write1DBarcode方法的具体用法?PHP TCPDF::write1DBarcode怎么用?PHP TCPDF::write1DBarcode使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类TCPDF
的用法示例。
在下文中一共展示了TCPDF::write1DBarcode方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: array
$pdf->SetFont('helvetica', '', 11);
// add a page
$pdf->AddPage();
// print a message
//$txt = "You can also export 1D barcodes in other formats (PNG, SVG, HTML). Check the examples inside the barcodes directory.\n";
//$pdf->MultiCell(70, 50, $txt, 0, 'J', false, 1, 125, 30, true, 0, false, true, 0, 'T', false);
//$pdf->SetY(30);
// -----------------------------------------------------------------------------
$pdf->SetFont('helvetica', '', 10);
// define barcode style
$style = array('position' => '', 'align' => 'C', 'stretch' => false, 'fitwidth' => true, 'cellfitalign' => '', 'border' => true, 'hpadding' => 'auto', 'vpadding' => 'auto', 'fgcolor' => array(0, 0, 0), 'bgcolor' => false, 'text' => true, 'font' => 'helvetica', 'fontsize' => 8, 'stretchtext' => 4);
// Standard 2 of 5
//$pdf->Cell(0, 0, 'PUNTO MODA', 0, 1);
//$pdf->write1DBarcode('TECHNO', 'S25', '', '', '', 18, 0.4, $style, 'N');
//$pdf->Ln();
// set a background color
//$style['bgcolor'] = array(255,255,240);
//$style['fgcolor'] = array(127,0,0);
$pdf->Cell(1, 1, 'PUNTO MODA', 0, 2, 'L');
$style['position'] = 'L';
$pdf->write1DBarcode('LEFT', 'C128A', 10, '', '', 20, 0.4, $style, 'N');
//$pdf->Ln();
//$pdf->Cell(1, 1, 'PUNTO MODA', 0, 2,'L');
//$style['position'] = 'L';
//$pdf->write1DBarcode('LEFT', 'C128A', 100, '', '', 20, 0.4, $style, 'N');
// ---------------------------------------------------------
//Close and output PDF document
$pdf->Output('example_027.pdf', 'I');
//============================================================+
// END OF FILE
//============================================================+
示例2:
$pdf->Cell(6.4, 0.4, "" . $datos[$fila][6] . "", 0, 0, 'C');
//distrito
$pdf->Ln();
//octava fila
//$fila=$f;
$pdf->Cell(6.4, 3.3, "", 0, 0, 'C');
$pdf->Cell(0.8, 3.3, "", 0, 0, 'C');
//$fila=$f+1;
$pdf->Cell(6.4, 3.3, "", 0, 0, 'C');
$pdf->Cell(0.8, 3.3, "", 0, 0, 'C');
//$fila=$f+2;
$pdf->Cell(6.4, 3.3, "", 0, 0, 'C');
$pdf->Ln();
//novena fila CODIGO DE BARRAS
$fila = $f;
$pdf->write1DBarcode("" . $datos[$fila][0] . "", "C39", '', '', 6.4, 0.5, 0.03, $style, 'M');
$pdf->Cell(0.8, 0.7, " ", 0, 0, 'C');
$fila = $f + 1;
$pdf->write1DBarcode("" . $datos[$fila][0] . "", "C39", '', '', 6.4, 0.5, 0.03, $style, 'M');
$pdf->Cell(0.8, 0.7, " ", 0, 0, 'C');
$fila = $f + 2;
$pdf->write1DBarcode("" . $datos[$fila][0] . "", "C39", '', '', 6.4, 0.5, 0.03, $style, 'M');
$pdf->Cell(0.8, 0.7, " ", 0, 0, 'C');
$pdf->Ln();
if ($nfilas <= 3) {
//fila margen
$pdf->Cell(6.4, 0.8, "", 0, 0, 'C');
$pdf->Cell(0.8, 0.8, "", 0, 0, 'C');
$pdf->Cell(6.4, 0.8, "", 0, 0, 'C');
$pdf->Cell(0.8, 0.8, "", 0, 0, 'C');
$pdf->Cell(6.4, 0.8, "", 0, 0, 'C');
示例3: write1DBarcode2
/**
* see above - used for outputting barcodes of bundled products - smaller and no sku as text
*/
public function write1DBarcode2($code, $type, $x = '', $y = '', $w = '', $h = '', $xres = 0.4, $style = '', $align = 'T')
{
$this->SetX($this->GetX() + 4);
$style = array('position' => 'S', 'border' => false, 'padding' => 1, 'fgcolor' => array(0, 0, 0), 'bgcolor' => false, 'text' => false, 'font' => 'helvetica', 'fontsize' => 8, 'stretchtext' => 4);
parent::write1DBarcode($code, $type, $x, $y, $w, $h, $xres, $style, $align);
}
示例4: array
$pdf->SetFillColorArray($colorized && is_numeric($letter) ? $aColors[$letter] : array(255, 255, 255));
if ($textOrientation == 'vertical') {
$pdf->Cell($hBox, $wBox, $letter, 1, 2, 'C', true, '', 0, true);
} else {
$pdf->Cell($wBox, $hBox, $letter, 1, 0, 'C', true, '', 0, true);
}
}
if ($textOrientation == 'vertical') {
$pdf->StopTransform();
}
// Print media name in a box of its own
if ($tape != 'dlt') {
$pdf->SetFontSize($fontSize);
if ($textOrientation == 'vertical') {
// begin at bottom left, and start a rotation
$pdf->SetXY($posX + $radius + $wBox * 6, $posY + $hLabel);
$pdf->StartTransform();
$pdf->Rotate(90);
$pdf->Cell($hBox, $wBox, strtoupper($tape), 1, 0, 'C', false, '', 0, true);
$pdf->StopTransform();
} else {
$pdf->SetX($posX + $radius + $wBox * 6);
$pdf->Cell($wBox, $hBox, strtoupper($tape), 1, 0, 'C', false, '', 0, true);
}
$txt .= strtoupper($tape);
}
// Finish with the actual barcode
$pdf->write1DBarcode($txt, 'C39', $posX, $posY + $paddingTop, $wLabel, $hBarcode, '', $style);
}
}
$pdf->Output('barcodes.pdf', 'D');
示例5:
$print = 1;
}
if ($end == $count) {
$print = 0;
}
$row = $count / 3;
$col = $count % 3;
$pos[$row][$col] = $print;
}
//barcode height
$h = 11;
//column width
$w = 67.5;
foreach ($pos as $line) {
if ($line[0]) {
$pdf->write1DBarcode(($product->getBarcode() ? $product->getBarcode() : $product->getId()) . str_pad("", 5, "0", STR_PAD_LEFT), 'EAN13', '12.5', '', '', $h, 0.4, $style, 'T');
}
if ($line[1]) {
$pdf->write1DBarcode(($product->getBarcode() ? $product->getBarcode() : $product->getId()) . str_pad("", 5, "0", STR_PAD_LEFT), 'EAN13', '80', '', '', $h, 0.4, $style, 'T');
}
if ($line[2]) {
$pdf->write1DBarcode(($product->getBarcode() ? $product->getBarcode() : $product->getId()) . str_pad("", 5, "0", STR_PAD_LEFT), 'EAN13', '147.5', '', '', $h, 0.4, $style, 'T');
}
$pdf->write1DBarcode('4800529501110', 'EAN13', '500', '', '', $h, 0.4, $style, 'N');
if ($line[0]) {
$pdf->Cell($w, 0, $product->getName(), 0, 0);
} else {
$pdf->Cell($w, 0, '', 0, 0);
}
if ($line[1]) {
$pdf->Cell($w, 0, $product->getName(), 0, 0);
示例6: formats
// set font
$pdf->SetFont('helvetica', '', 11);
// add a page
$pdf->AddPage();
// print a message
$txt = "You can also export 1D barcodes in other formats (PNG, SVG, HTML). Check the examples inside the barcodes directory.\n";
$pdf->MultiCell(70, 50, $txt, 0, 'J', false, 1, 125, 30, true, 0, false, true, 0, 'T', false);
$pdf->SetY(30);
// -----------------------------------------------------------------------------
$pdf->SetFont('helvetica', '', 10);
// define barcode style
$style = array('position' => '', 'align' => 'C', 'stretch' => false, 'fitwidth' => true, 'cellfitalign' => '', 'border' => true, 'hpadding' => 'auto', 'vpadding' => 'auto', 'fgcolor' => array(0, 0, 0), 'bgcolor' => false, 'text' => true, 'font' => 'helvetica', 'fontsize' => 8, 'stretchtext' => 4);
// PRINT VARIOUS 1D BARCODES
// CODE 39 - ANSI MH10.8M-1983 - USD-3 - 3 of 9.
$pdf->Cell(0, 0, 'CODE 39 - ANSI MH10.8M-1983 - USD-3 - 3 of 9', 0, 1);
$pdf->write1DBarcode('CODE 39', 'C39', '', '', '', 18, 0.4, $style, 'N');
$pdf->Ln();
// CODE 39 + CHECKSUM
$pdf->Cell(0, 0, 'CODE 39 + CHECKSUM', 0, 1);
$pdf->write1DBarcode('CODE 39 +', 'C39+', '', '', '', 18, 0.4, $style, 'N');
$pdf->Ln();
// CODE 39 EXTENDED
$pdf->Cell(0, 0, 'CODE 39 EXTENDED', 0, 1);
$pdf->write1DBarcode('CODE 39 E', 'C39E', '', '', '', 18, 0.4, $style, 'N');
$pdf->Ln();
// CODE 39 EXTENDED + CHECKSUM
$pdf->Cell(0, 0, 'CODE 39 EXTENDED + CHECKSUM', 0, 1);
$pdf->write1DBarcode('CODE 39 E+', 'C39E+', '', '', '', 18, 0.4, $style, 'N');
$pdf->Ln();
// CODE 93 - USS-93
$pdf->Cell(0, 0, 'CODE 93 - USS-93', 0, 1);
示例7: array
//set auto page breaks
$pdf->SetAutoPageBreak(TRUE, PDF_MARGIN_BOTTOM);
//set image scale factor
$pdf->setImageScale(PDF_IMAGE_SCALE_RATIO);
//set some language-dependent strings
$pdf->setLanguageArray($l);
// ---------------------------------------------------------
// set a barcode on the page footer
$pdf->setBarcode(date('Y-m-d H:i:s'));
// set font
$pdf->SetFont('helvetica', '', 10);
// add a page
$pdf->AddPage();
$style = array('position' => 'S', 'border' => true, 'padding' => 4, 'fgcolor' => array(0, 0, 0), 'bgcolor' => false, 'text' => true, 'font' => 'helvetica', 'fontsize' => 8, 'stretchtext' => 4);
// CODE 39
$pdf->write1DBarcode('CODE 39', 'C39', '', '', 80, 30, 0.4, $style, 'N');
$pdf->Ln();
// CODE 39 with checksum
$pdf->write1DBarcode('CODE 39 +', 'C39+', '', '', 80, 30, 0.4, $style, 'N');
$pdf->Ln();
// CODE 39 EXTENDED
$pdf->write1DBarcode('CODE 39 E', 'C39E', '', '', 80, 30, 0.4, $style, 'N');
$pdf->Ln();
// CODE 39 EXTENDED with checksum
$pdf->write1DBarcode('CODE 39 E+', 'C39E+', '', '', 80, 30, 0.4, $style, 'N');
$pdf->Ln();
// Interleaved 2 of 5
$pdf->write1DBarcode('12345678', 'I25', '', '', 80, 30, 0.4, $style, 'N');
$pdf->Ln();
// CODE 128 A
$pdf->write1DBarcode('CODE 128 A', 'C128A', '', '', 80, 30, 0.4, $style, 'N');
示例8: array
//set image scale factor
$pdf->setImageScale(PDF_IMAGE_SCALE_RATIO);
//set some language-dependent strings
$pdf->setLanguageArray($l);
//initialize document
$pdf->AliasNbPages();
// add a page
$pdf->AddPage();
// ---------------------------------------------------------
// set a barcode on the page footer
$pdf->setBarcode("2008-06-10 19:37");
// set font
$pdf->SetFont("helvetica", "", 10);
$style = array("position" => "S", "border" => true, "padding" => 4, "fgcolor" => array(0, 0, 0), "bgcolor" => false, "text" => true, "font" => "helvetica", "fontsize" => 8, "stretchtext" => 4);
// CODE 39
$pdf->write1DBarcode("CODE 39", "C39", '', '', 80, 30, 0.4, $style, 'N');
$pdf->Ln();
// CODE 39 with checksum
$pdf->write1DBarcode("CODE 39 +", "C39+", '', '', 80, 30, 0.4, $style, 'N');
$pdf->Ln();
// CODE 39 EXTENDED
$pdf->write1DBarcode("CODE 39 E", "C39E", '', '', 80, 30, 0.4, $style, 'N');
$pdf->Ln();
// CODE 39 EXTENDED with checksum
$pdf->write1DBarcode("CODE 39 E+", "C39E+", '', '', 80, 30, 0.4, $style, 'N');
$pdf->Ln();
// Interleaved 2 of 5
$pdf->write1DBarcode("12345678", "I25", '', '', 80, 30, 0.4, $style, 'N');
$pdf->Ln();
// CODE 128 A
$pdf->write1DBarcode("CODE 128 A", "C128A", '', '', 80, 30, 0.4, $style, 'N');
示例9: testPdfOutput
public function testPdfOutput()
{
// create new PDF document
$pdf = new TCPDF(PDF_PAGE_ORIENTATION, PDF_UNIT, PDF_PAGE_FORMAT, true, 'UTF-8', false);
// set document information
$pdf->SetCreator(PDF_CREATOR);
$pdf->SetAuthor('Nicola Asuni');
$pdf->SetTitle('TCPDF Example 027');
$pdf->SetSubject('TCPDF Tutorial');
$pdf->SetKeywords('TCPDF, PDF, example, test, guide');
// set default header data
$pdf->SetHeaderData(PDF_HEADER_LOGO, PDF_HEADER_LOGO_WIDTH, PDF_HEADER_TITLE . ' 027', PDF_HEADER_STRING);
// set header and footer fonts
$pdf->setHeaderFont(array(PDF_FONT_NAME_MAIN, '', PDF_FONT_SIZE_MAIN));
$pdf->setFooterFont(array(PDF_FONT_NAME_DATA, '', PDF_FONT_SIZE_DATA));
// set default monospaced font
$pdf->SetDefaultMonospacedFont(PDF_FONT_MONOSPACED);
// set margins
$pdf->SetMargins(PDF_MARGIN_LEFT, PDF_MARGIN_TOP, PDF_MARGIN_RIGHT);
$pdf->SetHeaderMargin(PDF_MARGIN_HEADER);
$pdf->SetFooterMargin(PDF_MARGIN_FOOTER);
// set auto page breaks
$pdf->SetAutoPageBreak(TRUE, PDF_MARGIN_BOTTOM);
// set image scale factor
$pdf->setImageScale(PDF_IMAGE_SCALE_RATIO);
// set some language-dependent strings (optional)
$pdf->setLanguageArray($this->langSettings);
// ---------------------------------------------------------
// set a barcode on the page footer
$pdf->setBarcode('2015-06-18 09:12:27');
// set font
$pdf->SetFont('helvetica', '', 11);
// add a page
$pdf->AddPage();
// print a message
$txt = "You can also export 1D barcodes in other formats (PNG, SVG, HTML). Check the examples inside the barcodes directory.\n";
$pdf->MultiCell(70, 50, $txt, 0, 'J', false, 1, 125, 30, true, 0, false, true, 0, 'T', false);
$pdf->SetY(30);
// -----------------------------------------------------------------------------
$pdf->SetFont('helvetica', '', 10);
// define barcode style
$style = array('position' => '', 'align' => 'C', 'stretch' => false, 'fitwidth' => true, 'cellfitalign' => '', 'border' => true, 'hpadding' => 'auto', 'vpadding' => 'auto', 'fgcolor' => array(0, 0, 0), 'bgcolor' => false, 'text' => true, 'font' => 'helvetica', 'fontsize' => 8, 'stretchtext' => 4);
// PRINT VARIOUS 1D BARCODES
// CODE 39 - ANSI MH10.8M-1983 - USD-3 - 3 of 9.
$pdf->Cell(0, 0, 'CODE 39 - ANSI MH10.8M-1983 - USD-3 - 3 of 9', 0, 1);
$pdf->write1DBarcode('CODE 39', 'C39', '', '', '', 18, 0.4, $style, 'N');
$pdf->Ln();
// CODE 39 + CHECKSUM
$pdf->Cell(0, 0, 'CODE 39 + CHECKSUM', 0, 1);
$pdf->write1DBarcode('CODE 39 +', 'C39+', '', '', '', 18, 0.4, $style, 'N');
$pdf->Ln();
// CODE 39 EXTENDED
$pdf->Cell(0, 0, 'CODE 39 EXTENDED', 0, 1);
$pdf->write1DBarcode('CODE 39 E', 'C39E', '', '', '', 18, 0.4, $style, 'N');
$pdf->Ln();
// CODE 39 EXTENDED + CHECKSUM
$pdf->Cell(0, 0, 'CODE 39 EXTENDED + CHECKSUM', 0, 1);
$pdf->write1DBarcode('CODE 39 E+', 'C39E+', '', '', '', 18, 0.4, $style, 'N');
$pdf->Ln();
// CODE 93 - USS-93
$pdf->Cell(0, 0, 'CODE 93 - USS-93', 0, 1);
$pdf->write1DBarcode('TEST93', 'C93', '', '', '', 18, 0.4, $style, 'N');
$pdf->Ln();
// Standard 2 of 5
$pdf->Cell(0, 0, 'Standard 2 of 5', 0, 1);
$pdf->write1DBarcode('1234567', 'S25', '', '', '', 18, 0.4, $style, 'N');
$pdf->Ln();
// Standard 2 of 5 + CHECKSUM
$pdf->Cell(0, 0, 'Standard 2 of 5 + CHECKSUM', 0, 1);
$pdf->write1DBarcode('1234567', 'S25+', '', '', '', 18, 0.4, $style, 'N');
$pdf->Ln();
// Interleaved 2 of 5
$pdf->Cell(0, 0, 'Interleaved 2 of 5', 0, 1);
$pdf->write1DBarcode('1234567', 'I25', '', '', '', 18, 0.4, $style, 'N');
$pdf->Ln();
// Interleaved 2 of 5 + CHECKSUM
$pdf->Cell(0, 0, 'Interleaved 2 of 5 + CHECKSUM', 0, 1);
$pdf->write1DBarcode('1234567', 'I25+', '', '', '', 18, 0.4, $style, 'N');
// add a page ----------
$pdf->AddPage();
// CODE 128 AUTO
$pdf->Cell(0, 0, 'CODE 128 AUTO', 0, 1);
$pdf->write1DBarcode('CODE 128 AUTO', 'C128', '', '', '', 18, 0.4, $style, 'N');
$pdf->Ln();
// CODE 128 A
$pdf->Cell(0, 0, 'CODE 128 A', 0, 1);
$pdf->write1DBarcode('CODE 128 A', 'C128A', '', '', '', 18, 0.4, $style, 'N');
$pdf->Ln();
// CODE 128 B
$pdf->Cell(0, 0, 'CODE 128 B', 0, 1);
$pdf->write1DBarcode('CODE 128 B', 'C128B', '', '', '', 18, 0.4, $style, 'N');
$pdf->Ln();
// CODE 128 C
$pdf->Cell(0, 0, 'CODE 128 C', 0, 1);
$pdf->write1DBarcode('0123456789', 'C128C', '', '', '', 18, 0.4, $style, 'N');
$pdf->Ln();
// EAN 8
$pdf->Cell(0, 0, 'EAN 8', 0, 1);
$pdf->write1DBarcode('1234567', 'EAN8', '', '', '', 18, 0.4, $style, 'N');
$pdf->Ln();
//.........这里部分代码省略.........
示例10: imprimeCupomEntrada
public function imprimeCupomEntrada()
{
$objEmpresa = new fla_empresas();
global $path_relative;
$arrEmpresa = array();
$arrRotatividade = array();
$objModelo = new fla_modelos();
$objCliente = new fla_clientes();
$arrEmpresa = $objEmpresa->buscaEmpresas($objEmpresa);
$pdf = new TCPDF("P", PDF_UNIT, 'ETIQUETA', true, 'IBM850', false);
//$pdf = new TCPDF(PDF_PAGE_ORIENTATION, PDF_UNIT, PDF_PAGE_FORMAT, true, 'UTF-8', false);
$pdf->SetMargins(0, 0, 0, true);
//$pdf->SetMargins(PDF_MARGIN_LEFT,PDF_MARGIN_TOP,PDF_MARGIN_RIGHT);
$pdf->setPrintHeader(false);
$pdf->setPrintFooter(false);
$pdf->AddPage();
// $nom_prestador = limitar($arrEmpresa[0]['nom_fantasia'],25);
$nom_prestador = $arrEmpresa[0]['nom_fantasia'];
$end_prestador = $arrEmpresa[0]['des_endereco'];
$tel_prestador = $arrEmpresa[0]['num_telefone'];
$tel_prestador = mascara_string("(##) ####-####", $tel_prestador);
$horario_atendimento = "Horario de atendimento:\r\n07:00hrs as 19:00hrs";
$multa = "A perda deste cupom implicara \r\nem multa de R\$ 10,00";
$arrRotatividade = $this->buscaCarro($this);
$cod_cartao = $arrRotatividade[0]['cod_cartao'];
$hora_entrada = $arrRotatividade[0]['hor_entrada'];
$dat_entrada = mostraData($arrRotatividade[0]['dat_cadastro']);
$des_placa = strtoupper($arrRotatividade[0]['des_placa']);
$objCliente->set_des_placa($des_placa);
$arrCliente = $objCliente->buscaClientes($objCliente);
if (!empty($arrCliente[0]['cod_modelo'])) {
$objModelo->set_cod_modelo($arrCliente[0]['cod_modelo']);
$arrModelo = $objModelo->buscaModelos($objModelo);
$des_modelo = $arrModelo[0]['des_modelo'];
} else {
$des_modelo = 'Nao cadastrado';
}
$des_modelo = remove_acentuacao($des_modelo);
$pdf->SetFont('times', 'B', 8);
$pdf->Write($h = 0, $nom_prestador, $link = '', $fill = 0, $align = 'L', $ln = true, $stretch = 0, $firstline = false, $firstblock = false, $maxh = 0);
$pdf->SetFont('times', 'B', 10);
$conteudo_cabecalho = sprintf("%s \r\nTelefone: %s\r\n\r\n", $end_prestador, $tel_prestador);
$conteudo_cabecalho = iconv('UTF-8', 'IBM850', $conteudo_cabecalho);
$pdf->Write($h = 0, $conteudo_cabecalho, $link = '', $fill = 0, $align = 'L', $ln = true, $stretch = 0, $firstline = false, $firstblock = false, $maxh = 0);
$style = array('position' => 'L', 'border' => false, 'padding' => 5, 'fgcolor' => array(0, 0, 0), 'bgcolor' => false, 'text' => false, 'font' => 'helvetica', 'fontsize' => 3, 'stretchtext' => 2);
$pdf->write1DBarcode($cod_cartao, 'C128', '', '', 60, 18, 0.4, $style, 'N');
//$pdf->write1DBarcode($cod_cartao, 'C128A','','',60,18,0.4,$style,'N');
//$pdf->write1DBarcode($cod_cartao, 'C128B','','',60,18,0.4,$style,'N');
//$pdf->write1DBarcode($cod_cartao, 'C128C','','',60,18,0.4,$style,'N');
//$pdf->write1DBarcode($cod_cartao, 'C128B', '', '', 5, 5, 0.4, $style, 'N');
$cod_cartao = iconv('UTF-8', 'IBM850', $cod_cartao);
$pdf->Write($h = 0, 'Cartao: ' . $cod_cartao, $link = '', $fill = 0, $align = 'L', $ln = true, $stretch = 0, $firstline = false, $firstblock = false, $maxh = 0);
$pdf->SetFont('times', 'B', 12);
$pdf->Write($h = 0, "Dia: {$dat_entrada} \r\nHorario: {$hora_entrada}", $link = '', $fill = 0, $align = 'L', $ln = true, $stretch = 0, $firstline = false, $firstblock = false, $maxh = 0);
$conteudo_rodape = sprintf("\r\nVeiculo: %s\r\nPlaca: %s\r\n%s\r\n", $des_modelo, $des_placa, $horario_atendimento);
$pdf->SetFont('times', 'B', 12);
$conteudo_rodape = iconv('UTF-8', 'IBM850', $conteudo_rodape);
$pdf->Write($h = 0, $conteudo_rodape, $link = '', $fill = 0, $align = 'L', $ln = true, $stretch = 0, $firstline = false, $firstblock = false, $maxh = 0);
$pdf->SetFont('times', 'B', 10);
$multa = iconv('UTF-8', 'IBM850', $multa);
$pdf->Write($h = 0, $multa, $link = '', $fill = 0, $align = 'L', $ln = true, $stretch = 0, $firstline = false, $firstblock = false, $maxh = 0);
// write some JavaScript code
$js = <<<EOD
\t\t\t\tthis.print({bUI: true, bSilent: false, bShrinkToFit: true});
EOD;
// set javascript
$pdf->IncludeJS($js);
//$arquivo_cartao = $pdf->Output('CupomEntrada-'.$cod_cartao,"S");
//var_dump(file_put_contents($path_relative.'cupons/CupomEntrada-'.$cod_cartao, $arquivo_cartao));
//$arquivo = $path_relative.'cuponsEntrada/CupomEntrada-' . $cod_cartao.'.pdf';
//$pdf->Output($path_relative.'cuponsEntrada/CupomEntrada-' . $cod_cartao.'.pdf',"F");
$pdf->Output($path_relative . 'cuponsEntrada/CupomEntrada-' . $cod_cartao . '.pdf', "I");
//$pdf->Output('CupomEntrada-' . $cod_cartao.'.pdf','I');
//$comando = "C:\Sumatra\SumatraPDF.exe -print-to \"MP-2500 TH\" ".$arquivo;
//exec($comando);
}
示例11: showBarcode
public function showBarcode($data, $y)
{
$type = strtoupper($data['barcodetype']);
$height = $data['height'];
$width = $data['width'];
$x = $data['x'];
$y = $data['y'] + $y;
$textposition = $data['textposition'];
$code = $data['code'];
$code = $this->analyse_expression($code);
$modulewidth = $data['modulewidth'];
if ($textposition == "" || $textposition == "none") {
$withtext = false;
} else {
$withtext = true;
}
$style = array('border' => false, 'vpadding' => 'auto', 'hpadding' => 'auto', 'text' => $withtext, 'fgcolor' => array(0, 0, 0), 'bgcolor' => false, 'module_width' => 1, 'module_height' => 1);
//[2D barcode section]
//DATAMATRIX
//QRCODE,H or Q or M or L (H=high level correction, L=low level correction)
// -------------------------------------------------------------------
// PDF417 (ISO/IEC 15438:2006)
/*
The $type parameter can be simple 'PDF417' or 'PDF417' followed by a
number of comma-separated options:
'PDF417,a,e,t,s,f,o0,o1,o2,o3,o4,o5,o6'
Possible options are:
a = aspect ratio (width/height);
e = error correction level (0-8);
Macro Control Block options:
t = total number of macro segments;
s = macro segment index (0-99998);
f = file ID;
o0 = File Name (text);
o1 = Segment Count (numeric);
o2 = Time Stamp (numeric);
o3 = Sender (text);
o4 = Addressee (text);
o5 = File Size (numeric);
o6 = Checksum (numeric).
Parameters t, s and f are required for a Macro Control Block, all other parametrs are optional.
To use a comma character ',' on text options, replace it with the character 255: "\xff".
*/
switch ($type) {
case "PDF417":
$this->pdf->write2DBarcode($code, 'PDF417', $x, $y, $width, $height, $style, 'N');
break;
case "DATAMATRIX":
//$this->pdf->Cell( $width,10,$code);
if (left($code, 3) == "QR:") {
$code = right($code, strlen($code) - 3);
$this->pdf->write2DBarcode($code, 'QRCODE', $x, $y, $width, $height, $style, 'N');
} else {
$this->pdf->write2DBarcode($code, 'DATAMATRIX', $x, $y, $width, $height, $style, 'N');
}
break;
case "CODE128":
$this->pdf->write1DBarcode($code, 'C128', $x, $y, $width, $height, $modulewidth, $style, 'N');
// $this->pdf->write1DBarcode($code, 'C128', $x, $y, $width, $height,"", $style, 'N');
break;
case "EAN8":
$this->pdf->write1DBarcode($code, 'EAN8', $x, $y, $width, $height, $modulewidth, $style, 'N');
break;
case "EAN13":
$this->pdf->write1DBarcode($code, 'EAN13', $x, $y, $width, $height, $modulewidth, $style, 'N');
break;
case "CODE39":
$this->pdf->write1DBarcode($code, 'C39', $x, $y, $width, $height, $modulewidth, $style, 'N');
break;
case "CODE93":
$this->pdf->write1DBarcode($code, 'C93', $x, $y, $width, $height, $modulewidth, $style, 'N');
break;
}
}
示例12: array
<td align="center" ><strong><font color="#0A296B">Numero Tiquete:</font></strong><br/>{$num_tiquete}</td>
<td align="center" ><strong><font color="#0A296B">Estado Tiquete:</font></strong><br/>{$estado_tiquete}</td>
<td align="center" colspan="2"><strong><font size="12" color="#0A296B"></font></strong><font size="14" color="#FF0000"></font></td>
</tr>
</table>
EOD;
$pdf->writeHTML($tbl, true, false, false, false, '');
$pdf->SetFont('helvetica', '', 11);
// print a message
$pdf->SetFont('helvetica', '', 10);
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
// set style for barcode
$style = array('border' => false, 'vpadding' => 30, 'hpadding' => 30, 'fgcolor' => array(0, 0, 0), 'bgcolor' => false, 'module_width' => 0.6, 'module_height' => 0.6);
$id_tiquete = $_POST["id_tiquete"];
// QRCODE,Q : QR-CODE Better error correction
$pdf->write2DBarcode('http://200.71.38.34/aplicacion5.php?opcion=13&confirmacion=' . $id_tiquete, 'QRCODE,Q', 96, 17, 2900, 40, $style, 'N');
$pdf->SetFont('helvetica', '', 10);
$style = array('position' => '', 'align' => 'C', 'stretch' => false, 'fitwidth' => true, 'cellfitalign' => '', 'border' => false, 'hpadding' => 'auto', 'vpadding' => 'auto', 'fgcolor' => array(0, 0, 0), 'bgcolor' => false, 'text' => true, 'font' => 'helvetica', 'fontsize' => 8, 'stretchtext' => 4);
$doc_pasajero = $_POST["doc_pasajero"];
$pdf->Cell(0, 30, '', 0, 1);
$pdf->write1DBarcode("{$doc_pasajero}{$id_tiquete}", 'MSI+', '160', '28', '', 18, 0.4, $style, 'N');
$pdf->Ln();
//Start Graphic Transformation
$pdf->StartTransform();
// draw jpeg image to be clipped
$pdf->Image('images/home.png', 190, 11, 4, 4, '', 'http://200.71.38.34/html/aplicacion5.php?opcion=6', '', true, 70);
$pdf->Output('tiquete', 'I');
// close and output PDF document
//============================================================+
// END OF FILE
//============================================================+
示例13: get_barcode_report
/**
* @return object
* @throws SampleIDMissingException
* @throws BaseReportTCPDFClassMissingException
*/
public static function get_barcode_report()
{
if (class_exists("TCPDF")) {
if ($_GET['sample_id']) {
$sample_id = $_GET['sample_id'];
if ($_GET['paper_size']) {
$paper_size_info_array = PaperSize::get_size_by_id($_GET['paper_size']);
} else {
$paper_size_info_array = PaperSize::get_standard_size();
}
$format = array($paper_size_info_array['width'], $paper_size_info_array['height']);
if ($paper_size_info_array['width'] >= $paper_size_info_array['height']) {
$orientation = "L";
} else {
$orientation = "P";
}
$pdf = new TCPDF($orientation, "mm", $format, true, 'UTF-8', false);
$pdf->SetCreator(PDF_CREATOR);
$pdf->SetAuthor('Open-LIMS');
$pdf->SetTitle('Sample Report');
$pdf->setPrintHeader(false);
$pdf->setPrintFooter(false);
$pdf->SetDefaultMonospacedFont(PDF_FONT_MONOSPACED);
$pdf->SetMargins($paper_size_info_array['margin_left'], $paper_size_info_array['margin_top'], $paper_size_info_array['margin_right']);
$pdf->SetAutoPageBreak(TRUE, $paper_size_info_array['margin_bottom']);
$pdf->setImageScale(PDF_IMAGE_SCALE_RATIO);
$pdf->setLanguageArray($l);
$pdf->AddPage();
$page_width = $paper_size_info_array['width'] - $paper_size_info_array['margin_left'] - $paper_size_info_array['margin_right'];
$page_height = $paper_size_info_array['height'] - $paper_size_info_array['margin_top'];
$font_size = $page_height * 0.1;
if ($page_width * 0.6 > $page_height) {
$barcode_height = $page_height - $font_size;
$barcode_width = null;
} else {
$barcode_height = $page_width * 0.6;
$barcode_width = $page_width;
}
$print_sample_id = "S" . str_pad($sample_id, 8, '0', STR_PAD_LEFT);
$style = array('position' => '', 'align' => 'C', 'stretch' => true, 'fitwidth' => false, 'cellfitalign' => '', 'border' => false, 'hpadding' => 'auto', 'vpadding' => 'auto', 'fgcolor' => array(0, 0, 0), 'bgcolor' => false, 'text' => true, 'font' => 'helvetica', 'fontsize' => $font_size, 'stretchtext' => 4);
$pdf->write1DBarcode($print_sample_id, 'C128B', '', '', $barcode_width, $barcode_height, 0.2, $style, 'M');
return $pdf;
} else {
throw new SampleIDMissingException();
}
} else {
throw new BaseReportTCPDFClassMissingException();
}
}
示例14: TCPDF
//.........这里部分代码省略.........
$fil_ids = $vdoc[$j];
$pdf->SetFillColor(255, 255, 255);
$pdf->SetTextColor(58, 35, 9);
$tipo = "";
$izq = 0;
$lugar = 0;
if ($j % 2 == 1) {
$izq = 106;
$lugar = 0;
} else {
$izq = 100;
$lugar = 1;
}
if ($j == $fin) {
if ($j % 2 == 1) {
for ($k = 1; $k <= 2; $k++) {
if ($k == 1) {
$pdf->MultiCell($izq, 0, $codigo, 0, 'J', 1, $lugar, '', '', true, 0, false, true, 0);
} else {
$pdf->MultiCell(82, 0, '', 0, 'J', 1, 1, '', '', true, 0, false, true, 0);
}
}
} else {
$pdf->MultiCell($izq, 0, $codigo, 0, 'J', 1, $lugar, '', '', true, 0, false, true, 0);
}
} else {
$pdf->MultiCell($izq, 0, $codigo, 0, 'J', 1, $lugar, '', '', true, 0, false, true, 0);
}
if ($j % 2 == 0) {
for ($i = 1; $i <= 2; $i++) {
if ($i % 2 == 1) {
$tipo = "";
$style = $style1;
$pdf->write1DBarcode(str_pad($codigoizquierda, 7, "0", STR_PAD_LEFT), 'C39', '', '', '', 18, 0.61, $style, $tipo);
} else {
$tipo = "N";
$style = $style2;
$pdf->write1DBarcode(str_pad($fil_ids, 7, "0", STR_PAD_LEFT), 'C39', '', '', '', 18, 0.61, $style, $tipo);
}
}
$pdf->Ln(11);
} else {
if ($j == $fin) {
$pdf->write1DBarcode(str_pad($fil_ids, 7, "0", STR_PAD_LEFT), 'C39', '', '', '', 18, 0.61, $style1, "");
}
}
$j++;
if ($j > 14) {
$pdf->SetMargins(6, 14, 4);
}
$codigoizquierda = $fil_ids;
}
//end foreach
// exp_id
} else {
if ($exp_id) {
$sql = "SELECT\r\n tab_expediente.exp_id,\r\n tab_archivo.fil_id,\r\n (SELECT fon_codigo from tab_fondo WHERE fon_id=f.fon_par) ||'.'|| f.fon_codigo ||'.'||tab_unidad.uni_cod ||'.'|| tab_tipocorr.tco_codigo ||'.'||tab_series.ser_codigo||'.'|| tab_expediente.exp_codigo as codigoexp,\r\n (SELECT fon_codigo from tab_fondo WHERE fon_id=f.fon_par) ||'.'|| f.fon_codigo ||'.'||tab_unidad.uni_cod ||'.'|| tab_tipocorr.tco_codigo ||'.'||tab_series.ser_codigo||'.'|| tab_expediente.exp_codigo||'.'||tab_archivo.fil_nro as codigo,\r\n tab_archivo.fil_nroejem,\r\n tab_archivo.fil_id,\r\n (SELECT SUM(tab_archivo.fil_nroejem::int) as cantidad\r\n FROM tab_archivo\r\n INNER JOIN tab_exparchivo ON tab_exparchivo.fil_id = tab_archivo.fil_id\r\n WHERE tab_exparchivo.exp_id = '{$exp_id}' \r\n AND tab_archivo.fil_estado = 1) as exp_nroejem\r\n FROM\r\n tab_fondo as f\r\n INNER JOIN tab_unidad ON f.fon_id = tab_unidad.fon_id\r\n INNER JOIN tab_series ON tab_unidad.uni_id = tab_series.uni_id\r\n INNER JOIN tab_tipocorr ON tab_tipocorr.tco_id = tab_series.tco_id\r\n INNER JOIN tab_expediente ON tab_series.ser_id = tab_expediente.ser_id\r\n INNER JOIN tab_exparchivo ON tab_expediente.exp_id = tab_exparchivo.exp_id\r\n INNER JOIN tab_archivo ON tab_archivo.fil_id = tab_exparchivo.fil_id\r\n INNER JOIN tab_expisadg ON tab_expediente.exp_id = tab_expisadg.exp_id\r\n INNER JOIN tab_expusuario ON tab_expediente.exp_id = tab_expusuario.exp_id\r\n INNER JOIN tab_cuerpos ON tab_cuerpos.cue_id = tab_exparchivo.cue_id\r\n INNER JOIN tab_tramitecuerpos ON tab_cuerpos.cue_id = tab_tramitecuerpos.cue_id\r\n INNER JOIN tab_tramite ON tab_tramite.tra_id = tab_tramitecuerpos.tra_id\r\n WHERE\r\n f.fon_estado = 1\r\n AND tab_unidad.uni_estado = 1\r\n AND tab_tipocorr.tco_estado = 1\r\n AND tab_series.ser_estado = 1\r\n AND tab_expediente.exp_estado = 1\r\n AND tab_archivo.fil_estado = 1\r\n AND tab_exparchivo.exa_estado = 1\r\n AND tab_expusuario.eus_estado = 1\r\n AND tab_expediente.exp_id ='{$exp_id}'\r\n {$where}\r\n ORDER BY\r\n f.fon_cod,\r\n tab_unidad.uni_cod,\r\n tab_series.ser_orden,\r\n tab_series.ser_codigo,\r\n tab_expediente.exp_codigo::int,\r\n tab_archivo.fil_nro::int ";
$tab_archivo = new Tab_archivo();
$result = $tab_archivo->dbSelectBySQL($sql);
if ($result) {
$ini = 1;
$n = 1;
$exp_id = 0;
foreach ($result as $cant) {
if ($exp_id != $cant->exp_id) {
// Exp
示例15: createPdf
/**
*
* Create a pdf with the labels
*
*/
function createPdf()
{
global $conf, $mysoc, $db, $langs;
$langs->load("other");
require_once DOL_DOCUMENT_ROOT . '/includes/tcpdf/tcpdf.php';
require_once DOL_DOCUMENT_ROOT . "/product/class/product.class.php";
require_once DOL_DOCUMENT_ROOT . "/core/lib/product.lib.php";
$pdf = new TCPDF();
$pdf->SetFont('dejavusans', '', 10);
$lab_start = $conf->global->LAB_START;
if ($conf->global->MAIN_MODULE_LABELPRINT_LABELS_0) {
$PosY = 5 + floor($lab_start / 3) * 36;
} else {
$PosY = 4 + floor($lab_start / 3) * 37;
}
//$PosY=3;
$PosX = 5 + $lab_start % 3 * 70;
//$PosX=5;
$Line = 5;
// define barcode style
$style = array('position' => '', 'align' => 'C', 'stretch' => false, 'fitwidth' => true, 'cellfitalign' => '', 'border' => false, 'hpadding' => 'auto', 'vpadding' => 'auto', 'fgcolor' => array(0, 0, 0), 'bgcolor' => false, 'text' => true, 'font' => 'helvetica', 'fontsize' => 8, 'stretchtext' => 4);
//First page
$pdf->AddPage();
$sql = "SELECT fk_product, qty, price_level";
$sql .= " FROM " . MAIN_DB_PREFIX . "labelprint";
$sql .= " WHERE entity=" . $conf->entity;
$resql = $db->query($sql);
if ($resql) {
$num = $db->num_rows($resql);
$i = 0;
while ($i < $num) {
$objp = $db->fetch_object($resql);
$product = new Product($db);
$product->fetch($objp->fk_product);
$qty = $objp->qty;
$n = 0;
while ($n < $qty) {
//Position X
$PosXLabel = $PosX < 70 ? $PosX : $PosX - 3;
//Soc Name
$pdf->SetFont('dejavusans', 'B', 10);
$pdf->SetXY($PosXLabel, $PosY);
$pdf->SetFillColor(230, 230, 230);
if ($conf->global->LAB_COMP) {
$pdf->MultiCell(65, 5, dol_trunc($mysoc->nom, 25), 0, 'L');
$flag = 1;
} elseif ($conf->global->LAB_PROD_LABEL) {
$pdf->MultiCell(65, 5, dol_trunc($product->libelle, 25), 0, 'L');
$flag = 2;
} else {
$pdf->MultiCell(65, 5, dol_trunc($conf->global->LAB_FREE_TEXT, 25), 0, 'L');
$flag = 3;
}
$pdf->SetFont('dejavusans', '', 10);
//Position Y
$PosYLabel = $PosY + $Line + 2;
//Product label
$pdf->SetXY($PosXLabel, $PosYLabel);
if ($flag == 1) {
if ($conf->global->LAB_PROD_LABEL) {
$pdf->Cell(25, 5, dol_trunc($product->libelle, 25), 0, 0, 'L');
} else {
$pdf->Cell(25, 5, dol_trunc($conf->global->LAB_FREE_TEXT, 25), 0, 0, 'L');
}
}
if ($flag == 2) {
$pdf->Cell(25, 5, dol_trunc($conf->global->LAB_FREE_TEXT, 25), 0, 0, 'L');
} else {
$pdf->Cell(25, 5, "", 0, 0, 'L');
}
//$pdf->Cell(25,5,dol_trunc($product->libelle,25),0,0,'L');
//$pdf->Write($Line,dol_trunc($product->libelle,25));
$PosYLabel = $PosYLabel + $Line + 2;
$pdf->SetXY($PosXLabel, $PosYLabel);
//Barcode
if ($conf->barcode->enabled) {
$product->fetch_barcode();
$pdf->write1DBarcode($product->barcode, $product->barcode_type_code, '', '', 35, 18, 0.4, $style, 'N');
}
//Price
$pdf->SetFont('dejavusans', 'B', 10);
if (empty($conf->global->PRODUIT_MULTIPRICES)) {
$labelPrice = price($product->price_ttc);
} else {
$labelPrice = price($product->multiprices_ttc[$objp->price_level]);
}
$pdf->SetXY($PosXLabel + 38, $PosYLabel);
$pdf->Cell(25, 5, $labelPrice, 0, 0, 'R');
$PosYLabel = $PosYLabel + $Line + 1;
$labelPrice = $langs->trans(currency_name($conf->currency));
$pdf->SetXY($PosXLabel + 38, $PosYLabel);
$pdf->Cell(25, 5, $labelPrice, 0, 0, 'R');
$PosYLabel = $PosYLabel + $Line;
if ($conf->global->LAB_WEIGHT) {
$labelSet = $product->weight;
//.........这里部分代码省略.........