getBarcodeHTML() public method

Return an HTML representation of barcode.
public getBarcodeHTML ( $w = 2, $h = 30, $color = 'black' ) : string
$w (int) Width of a single bar element in pixels.
$h (int) Height of a single bar element in pixels.
$color (string) Foreground color for bar elements (background is transparent).
return string HTML code.
Beispiel #1
0
 /**
  * Impression d'un recu grace a l'operation caisse idcaisse
  * Afficher avant de proposer une impression
  * @param type $idcaisse
  */
 public function recu($idcaisse)
 {
     if (!isAuth(522)) {
         return;
     }
     $this->view->clientsJS("caisse" . DS . "recu");
     $view = new View();
     $operation = $this->Caisse->get($idcaisse);
     $view->Assign("operation", $operation);
     $this->loadBarcode(BARCODE_1);
     $barcodeobj = new TCPDFBarcode($operation['REFCAISSE'], 'C128A');
     $view->Assign("barcode", $barcodeobj->getBarcodeHTML(1, 35, 'black'));
     $personnel = $this->Personnel->getBy(["USER" => $this->session->iduser]);
     if (!empty($operation['PERCUPAR'])) {
         $percepteur = $this->Personnel->get($operation['PERCUPAR']);
         $view->Assign("percepteur", $percepteur);
     }
     if (!empty($operation['IMPRIMERPAR'])) {
         $imprimeur = $this->Personnel->get($operation['IMPRIMERPAR']);
     } else {
         $imprimeur = $personnel;
     }
     $percepteur = $this->Personnel->get($operation['PERCUPAR']);
     $view->Assign("percepteur", $percepteur);
     $enregistreur = $this->Personnel->get($operation['ENREGISTRERPAR']);
     $view->Assign("enregistreur", $enregistreur);
     $view->Assign("imprimeur", $imprimeur);
     $view->Assign("estDirectrice", $this->session->idprofile === DIRECTOR_PROFILE ? true : false);
     $classe = $this->Eleve->getClasse($operation['ELEVE'], $this->session->anneeacademique);
     $view->Assign("classe", $classe);
     $montantapayer = $this->Frais->getClasseTotalFrais($classe['IDCLASSE']);
     $view->Assign("montantapayer", $montantapayer);
     $montantpayer = $this->Caisse->getMontantPayer($operation['ELEVE']);
     $view->Assign("montantpayer", $montantpayer);
     $content = $view->Render("caisse" . DS . "recu", false);
     $this->Assign("content", $content);
 }
Beispiel #2
0
 public function getBarCodeHTML()
 {
     $barcode = new TCPDFBarcode("E:{$this->id}", 'C128');
     return $barcode->getBarcodeHTML(1, 8);
 }
//
// TCPDF is distributed in the hope that it will be useful, but
// WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
// See the GNU Lesser General Public License for more details.
//
// You should have received a copy of the GNU Lesser General Public License
// along with TCPDF.  If not, see <http://www.gnu.org/licenses/>.
//
// See LICENSE.TXT file for more information.
// -------------------------------------------------------------------
//
// Description : Example for tcpdf_barcodes_1d.php class
//
//============================================================+
/**
 * @file
 * Example for tcpdf_barcodes_1d.php class
 * @package com.tecnick.tcpdf
 * @author Nicola Asuni
 * @version 1.0.000
 */
// include 1D barcode class
require_once dirname(__FILE__) . '/../../tcpdf_barcodes_1d.php';
// set the barcode content and type
$barcodeobj = new TCPDFBarcode('http://www.tcpdf.org', 'C128');
// output the barcode as HTML object
echo $barcodeobj->getBarcodeHTML(2, 30, 'black');
//============================================================+
// END OF FILE
//============================================================+
Beispiel #4
0
 protected function getHtml($code, $type)
 {
     $barcode = new \TCPDFBarcode($code, $type);
     return $barcode->getBarcodeHTML(2, 30, 'black');
 }
Beispiel #5
-1
function getBarcode($sample)
{
    require "../tcpdf/tcpdf_barcodes_1d.php";
    if (!$sample) {
        echo "";
    } else {
        $barcodeobj = new TCPDFBarcode($sample, 'C128');
        echo $barcodeobj->getBarcodeHTML(2, 30, 'black');
    }
}