Skip to content

Instantly share code, notes, and snippets.

@amirhp-com
Last active November 11, 2024 00:04
Show Gist options
  • Save amirhp-com/28d09a52424ff2daff4ca657aeb6d0a1 to your computer and use it in GitHub Desktop.
Save amirhp-com/28d09a52424ff2daff4ca657aeb6d0a1 to your computer and use it in GitHub Desktop.
Generate a Vertical barcode using Picqer/Barcode and Help of PeproDev Ultimate Invoice for mPDF
<?php
/*
* Generate a Vertical barcode using Picqer/Barcode and Help of PeproDev Ultimate Invoice for mPDF
* https://www.linkedin.com/posts/activity-7241606637805858816-Kg9l
*/
try {
global $PeproUltimateInvoice;
$generator = $PeproUltimateInvoice->barcode;
$barcode_text = "123456789";
$barcode = 'data:image/jpeg;base64,' . base64_encode($generator->getBarcode($barcode_text, $generator::TYPE_CODE_128));;
echo "<img src='$barcode' rotate='90' style='width:30px; height:100px; margin: 8px 0 4px;'>";
} catch (\Throwable $th) {
//throw $th;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment