Set X and Y Dimensions (PHP SDK)

Skip to end of metadata
Go to start of metadata
This example allows you to generate a barcode and set X and Y dimensions using Saaspose Barcode PHP SDK.
           //create BarcodeBuilder object
           $builder = new BarcodeBuilder();
	   //set parameters
           $codeText = "HelloWorld";
	   $symbology = "Code128";
	   $imageFormat = "png";
	   $xDimension = 4; //Set 0 for default
	   $yDimension = 4; //Set 0 for default

	   echo "Generating " . $symbology . " barcode... </br>";

	   //save output barcode image as required format
           $outputPath = $builder->Save($codeText, $symbology, $imageFormat, null, null, $xDimension, $yDimension);

	   echo "Barcode generated and saved as " . $outputPath;
Enter labels to add to this page:
Please wait 
Looking for a label? Just start typing.