Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

I can't scan the ean 13 code #4

Open
cwstrmnn opened this issue Dec 10, 2018 · 2 comments
Open

I can't scan the ean 13 code #4

cwstrmnn opened this issue Dec 10, 2018 · 2 comments

Comments

@cwstrmnn
Copy link

cwstrmnn commented Dec 10, 2018

I can't scan the produced ean-13 barcode. This is my code:

`include 'barcode.php';

$format = 'png';
$symbology = 'ean-13-pad';
$data = '978020137963';
$options = '';

$generator = new barcode_generator();

$name = "test";

/* Create bitmap image. */

$image = $generator->render_image($symbology, $data, $options);
header( "Content-type: image/png" );
imagepng($image);
$save = strtolower($name) .".png";
chmod($save,0755);
imagepng($image, $save, 0, NULL);
imagedestroy($image);
`

@hASebUh
Copy link

hASebUh commented Feb 27, 2022

I think u r missing the last check Digit!
so far as I see it generates barcodes with the numbers you type in but it do not calculate the checkout for the end!

@ambientguitar
Copy link

ambientguitar commented Mar 9, 2023

I cannot get the barcode to create any suggestions would be really appreciated.

include 'barcode.php';

$generator = new barcode_generator();

if (!empty($_POST["barcode"])) {
	$code= $_POST["barcode"];
	$targetPath = __DIR__ .'\barcode';
        $format='png';
        $symbology='ean-13-PAD';
        $options= '';
        $name = "test";
   

       file_put_contents( 'C:\temp\logs\debug_barcodes_' . time() . '.log', var_export( $code, true), FILE_APPEND);
  
	if (!is_dir($targetPath)) {
	   file_put_contents(  'C:\temp\logs\debug_barcodes_' . time() . '.log' . time() . '.log', var_export( ' No Directory - Creating One - '. 
           $targetPath, true), FILE_APPEND);
            mkdir($targetPath, 0777, true);
    } else {
		chmod($targetPath,0755);
	        file_put_contents(  'C:\temp\logs\debug_barcodes_' . time() . '.log', var_export(' NOT CREATING  DIRECTORY AS  ****** IT 
              ALREADY EXISTS ****** '. $targetPath, true), FILE_APPEND);
	}
	
	
	/* Generate PNG and write to file. */
	
	header("Content-Type:image/$format");
	$image = $generator->render_image($symbology, $code, $options);	
	$save = strtolower($name).".png";
	chmod($save,0755);
        imagepng($image, $save, 0, NULL);
        imagedestroy($image);
	//$svg = $generator->render_svg($symbology,$code,$options);
        //echo $svg;	
	///file_put_contents($targetPath , $svg);	

 }  

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants