// 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_2d.php class // // ============================================================+ /** * @file * Example for tcpdf_barcodes_2d.php class * * @package com.tecnick.tcpdf * @author Nicola Asuni * @version 1.0.009 */ // include 2D barcode class (search for installation path) require_once dirname(__FILE__) . '/tcpdf_barcodes_2d_include.php'; // set the barcode content and type $barcodeobj = new TCPDF2DBarcode('http://www.tcpdf.org', 'QRCODE,H'); // output the barcode as HTML object echo $barcodeobj->getBarcodeHTML(6, 6, 'black'); //============================================================+ // END OF FILE //============================================================+
<?php include_once 'jwt/vendor/autoload.php'; include_once 'TCPDF/tcpdf_barcodes_2d.php'; include_once 'uuid/vendor/autoload.php'; $signer = new \Lcobucci\JWT\Signer\Hmac\Sha512(); $token = (new Lcobucci\JWT\Builder())->setIssuer('http://example.com')->setAudience('http://example.org')->setId(\Ramsey\Uuid\Uuid::uuid4(), true)->setIssuedAt(time())->setNotBefore(time() + 60)->setExpiration(time() + 3600)->set('uid', array('user_select', 'user_delete'))->sign($signer, 'testing')->getToken(); // Retrieves the generated token //echo $token; // The string representation of the object is a JWT string (pretty easy, right?) $barcodeobj = new TCPDF2DBarcode((string) $token, 'QRCODE,H'); header('Content-Type:application/json'); echo json_encode(array('token' => (string) $token, 'link' => 'http://jwt.io#id_token=' . $token, 'barcode' => $barcodeobj->getBarcodeHTML(3, 3)));
user_verifycode=NULL WHERE user_id=' . $userid . ''; if (!($ru = F_db_query($sqlu, $db))) { F_display_db_error(false); } else { F_print_error('MESSAGE', $l['m_user_registration_ok']); echo K_NEWLINE; echo '<div class="container">' . K_NEWLINE; if (K_OTP_LOGIN) { require_once '../../shared/tcpdf/tcpdf_barcodes_2d.php'; $host = preg_replace('/[h][t][t][p][s]?[:][\\/][\\/]/', '', K_PATH_HOST); $qrcode = new TCPDF2DBarcode('otpauth://totp/' . $m['user_name'] . '@' . $host . '?secret=' . $m['user_otpkey'], 'QRCODE,H'); echo '<p>' . $l['m_otp_qrcode'] . '</p>' . K_NEWLINE; echo '<h2>' . $m['user_otpkey'] . '</h2>' . K_NEWLINE; echo '<div style="margin:40px 40px 40px 40px;">' . K_NEWLINE; echo $qrcode->getBarcodeHTML(6, 6, 'black'); echo '</div>' . K_NEWLINE; } echo '<p><strong><a href="index.php" title="' . $l['h_index'] . '">' . $l['h_index'] . ' ></a></strong></p>' . K_NEWLINE; echo '</div>' . K_NEWLINE; require_once '../code/tce_page_footer.php'; exit; } } } else { F_display_db_error(false); } F_print_error('ERROR', 'USER VERIFICATION ERROR'); echo K_NEWLINE; echo '<div class="container">' . K_NEWLINE; echo '<strong><a href="index.php" title="' . $l['h_index'] . '">' . $l['h_index'] . ' ></a></strong>' . K_NEWLINE;
// // 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_2d.php class // //============================================================+ /** * @file * Example for tcpdf_barcodes_2d.php class * @package com.tecnick.tcpdf * @author Nicola Asuni * @version 1.0.009 */ // include 2D barcode class (search for installation path) require_once dirname(__FILE__) . '/tcpdf_barcodes_2d_include.php'; // set the barcode content and type $barcodeobj = new TCPDF2DBarcode('http://www.tcpdf.org', 'PDF417'); // output the barcode as HTML object echo $barcodeobj->getBarcodeHTML(4, 4, 'black'); //============================================================+ // END OF FILE //============================================================+
protected function getAsHtml($code, $type) { $barcode = new \TCPDF2DBarcode($code, $type); return $barcode->getBarcodeHTML(6, 6, 'black'); }