public static function run($dataDir = null)
 {
     # Instantiate barcode object
     $bb = new BarCodeBuilder();
     # Set up code text (data to be encoded)
     $bb->setCodeText("1234567");
     # Set the symbology type to Code128
     $symbology = new Symbology();
     $bb->setSymbologyType($symbology->Code128);
     $caption = new Caption();
     $alignment = new Alignment();
     $caption->setText("Captions");
     $caption->setTextAlign($alignment->Middle);
     $bb->setCaptionAbove($caption);
     $bb->setCaptionBelow($caption);
     $bb->getCaptionAbove()->setTextAlign($alignment->Left);
     $bb->getCaptionAbove()->setText("Aspose");
     $bb->getCaptionAbove()->setVisible(true);
     #bb.getCaptionAbove().setFont(new java.awt.Font("Pristina", java.awt.Font.PLAIN, 14));
     #bb.getCaptionAbove().setForeColor(java.awt.Color.RED);
     $bb->getCaptionBelow()->setTextAlign($alignment->Right);
     $bb->getCaptionBelow()->setText("Aspose.BarCode Caption Below");
     $bb->getCaptionBelow()->setVisible(true);
     #bb.getCaptionBelow().setFont(new java.awt.Font("Pristina", Font.PLAIN, 14));
     #bb.getCaptionBelow().setForeColor(java.awt.Color.RED);
     # Save the image to your system and set its image format to Jpeg
     $barCodeImageFormat = new BarCodeImageFormat();
     $bb->save($dataDir . "barcode.jpg", $barCodeImageFormat->Jpeg);
     # Display Status
     print "Barcode with Captions saved successfully." . PHP_EOL;
 }
 public static function run($dataDir = null)
 {
     # Instantiate barcode object
     $bb = new BarCodeBuilder();
     # Set the code text of the barcode
     $bb->setCodeText("12345678");
     # Set the symbology type to code39
     $symbology = new Symbology();
     $bb->setSymbologyType($symbology->Code39Extended);
     # Set the wide to narrow ratio for the barcode
     $bb->setWideNarrowRatio(3.0);
     # Save the image to file
     $bb->save($dataDir . "barcode_ratio_3.jpg");
     # Set the wide to narrow ratio for the barcode
     $bb->setWideNarrowRatio(5.0);
     # Save the image to file
     $bb->save($dataDir . "barcode_ratio_5.jpg");
     # Set the wide to narrow ratio for the barcode
     $bb->setWideNarrowRatio(7.0);
     # Save the image to file
     $bb->save($dataDir . "barcode_ratio_7.jpg");
     # Set the wide to narrow ratio for the barcode
     $bb->setWideNarrowRatio(9.0);
     # Save the image to file
     $bb->save($dataDir . "barcode_ratio_9.jpg");
     # Display Status.
     print "BarCodes with different wide narrow ratios have been created successfully." . PHP_EOL;
 }
 public static function run($dataDir = null)
 {
     # Instantiate barcode object
     $bb = new BarCodeBuilder();
     # Set up code text (data to be encoded)
     $bb->setCodeText("1234567");
     # Set the symbology type to Code128
     $symbology = new Symbology();
     $bb->setSymbologyType($symbology->Code128);
     # Save the image to file
     $bb->save($dataDir . "barcode.jpg");
     # Set the x-dimension for the bars of the barcode
     $bb->setxDimension(0.5);
     # Save the image to file
     $bb->save($dataDir . "barcodeXDimensionChanged.jpg");
     # Instantiate barcode object
     $bb1 = new BarCodeBuilder();
     # Set the code text of the barcode
     $bb1->setCodeText("12345678");
     # Set the symbology type to code128
     $bb1->setSymbologyType($symbology->Pdf417);
     # Set the x-dimension for the bars of the barcode
     $bb1->setxDimension(0.5);
     # Save the image to file
     $bb1->save($dataDir . "barcodeYDimensionChanged.jpg");
     # Display Status.
     print "BarCodes with different dimensions have been created successfully." . PHP_EOL;
 }
 public static function run($dataDir = null)
 {
     # Instantiate barcode object
     $builder = new BarCodeBuilder();
     $symbology = new Symbology();
     $builder->setSymbologyType($symbology->Aztec);
     $builder->setCodeText("1234567890");
     # Save the image to your system and set its image format to Jpeg
     $builder->save($dataDir . "CreatingAztecBarcode.jpg");
     # Display Status
     print "Created Aztec Barcode Successfully." . PHP_EOL;
 }
 public static function run($dataDir = null)
 {
     $builder = new BarCodeBuilder();
     # ============ Code39Standard =====================
     # set symbology type
     $symbology = new Symbology();
     $builder->setSymbologyType($symbology->Code39Standard);
     # Save image to disk
     $builder->save($dataDir . "code39Standard.out.png");
     # ================== QR ===========================
     # set symbology type
     $builder->setSymbologyType($symbology->QR);
     # Save image to disk
     $builder->save($dataDir . "QR.out.png");
     # =============== Code128 =========================
     # set symbology type
     $builder->setSymbologyType($symbology->Code128);
     # Save image to disk
     $builder->save($dataDir . "code128.out.png");
     # Print message
     print "Barcode image(s) generated successfully." . PHP_EOL;
 }
 public static function run($dataDir = null)
 {
     # Instantiate barcode object
     $builder = new BarCodeBuilder();
     # Set Symbology type
     $symbology = new Symbology();
     $builder->setSymbologyType($symbology->PatchCode);
     # Set code text
     $builder->setCodeText("Patch T");
     # Save the image to your system and set its image format to Jpeg
     $builder->save($dataDir . "PatchCode.jpg");
     # Display Status
     print "Generated PatchCode Successfully." . PHP_EOL;
 }
 public static function run($dataDir = null)
 {
     # Instantiate barcode object
     $builder = new BarCodeBuilder();
     $symbology = new Symbology();
     $builder->setSymbologyType($symbology->Pdf417);
     $builder->setCodeText("1234567890");
     # Set Aspect Ratio to 3:2 or 1.5
     $builder->setAspectRatio(1.5);
     # Save the image
     $builder->save($dataDir . "SetAspectRatio.jpg");
     # Display Status
     print "Set Aspect Ratio Successfully." . PHP_EOL;
 }
 public static function run($dataDir = null)
 {
     # Instantiate barcode object
     $bb = new BarCodeBuilder();
     # Set the code text of the barcode
     $bb->setCodeText("12345678");
     # Roate clockwise for 180 degree (upside down)
     $bb->setRotationAngleF(180);
     # Set the symbology type to code39
     $symbology = new Symbology();
     $bb->setSymbologyType($symbology->Code39Extended);
     $bb->save($dataDir . "Rotate.jpg");
     # Display Status.
     print "Done with image rotation, please check the output file." . PHP_EOL;
 }
 public static function run($dataDir = null)
 {
     # Instantiate barcode object
     $builder = new BarCodeBuilder();
     $symbology = new Symbology();
     $builder->setSymbologyType($symbology->DataMatrix);
     $builder->setCodeText("The quick brown fox jumps over the lazy dog\n The quick brown fox jumps over the lazy dog\n");
     $codeLocation = new CodeLocation();
     $builder->setCodeLocation($codeLocation->None);
     $font = new Font();
     $builder->setCodeTextFont(new Font("Serif", $font->BOLD . $font->ITALIC, 20));
     # Save the image
     $builder->save($dataDir . "HideCodeText.jpg");
     # Display Status
     print "Hide Code Text Successfully." . PHP_EOL;
 }
 public static function run($dataDir = null)
 {
     # Instantiate barcode object
     $builder = new BarCodeBuilder();
     $symbology = new Symbology();
     $builder->setSymbologyType($symbology->QR);
     $builder->setCodeText("1234567890");
     # Hide code text
     $codeLocation = new CodeLocation();
     $builder->setCodeLocation($codeLocation->None);
     $builder->setRotationAngleF(90);
     # Save the image to your system and set its image format to Jpeg
     $builder->save($dataDir . "CreatingQRBarcode.jpg");
     # Display Status
     print "Created QR Barcode Successfully." . PHP_EOL;
 }
 public static function run($dataDir = null)
 {
     # Instantiate barcode object
     $bb = new BarCodeBuilder();
     # Set the Code text for the barcode
     $bb->setCodeText("1234567");
     # Set the symbology type to Code128
     $symbology = new Symbology();
     $bb->setSymbologyType($symbology->Code128);
     # Create an instance of resolution
     $resolutionMode = new ResolutionMode();
     $bb->setResolution(new Resolution(200, 400, $resolutionMode->Graphics));
     $bb->save($dataDir . "CustomizeBarcodeImageResolution.jpg");
     # Display Status.
     print "Customized Barcode Image Resolution, please check the output file." . PHP_EOL;
 }
 public static function set_codetext($dataDir = null)
 {
     # Instantiate barcode object
     $bb = new BarCodeBuilder();
     # Set the code text for the barcode
     $bb->setCodeText("Aspose-123");
     # Set the symbology type to Code128
     $symbology = new Symbology();
     $bb->setSymbologyType($symbology->Code128);
     # Set the width of the bars to 0.5 millimeter
     $bb->setxDimension(0.5);
     # save the barcode image to file
     $bb->save($dataDir . "codetext.out.jpg");
     # Print message
     print "Barcode image generated successfully." . PHP_EOL;
 }
 public static function run($dataDir = null)
 {
     # Instantiate barcode object
     $builder = new BarCodeBuilder();
     $symbology = new Symbology();
     $builder->setSymbologyType($symbology->Pdf417);
     # Width of each module
     $builder->setxDimension(0.6);
     # Height of each module
     $builder->setyDimension(1.2);
     $builder->setCodeText("this is some test code text. \n Second line \n third line.");
     # Save the image to your system and set its image format to Jpeg
     $builder->save($dataDir . "Creating2DBarcode.jpg");
     # Display Status
     print "Created 2D Barcode Successfully." . PHP_EOL;
 }
 public static function run($dataDir = null)
 {
     # Instantiate barcode object
     $bb = new BarCodeBuilder();
     # Set the code text of the barcode
     $bb->setCodeText("12345678");
     # Set the graphics drawing hint to be Anti Alias
     $imageQualityMode = new ImageQualityMode();
     $bb->setImageQuality($imageQualityMode->AntiAlias);
     # Set the symbology type to code39
     $symbology = new Symbology();
     $bb->setSymbologyType($symbology->Code39Extended);
     $bb->save($dataDir . "SetBarcodeImageQuality.jpg");
     # Display Status.
     print "Set Barcode Image Quality, please check the output file." . PHP_EOL;
 }
 public static function run($dataDir = null)
 {
     # Instantiate barcode object
     $bb = new BarCodeBuilder();
     # Set the Code text for the barcode
     $bb->setCodeText("1234567");
     # Set the symbology type to Code39
     $symbology = new Symbology();
     $bb->setSymbologyType($symbology->Code39Standard);
     # Make the checksum to be visible on the barcode
     $enableChecksum = new EnableChecksum();
     $bb->setEnableChecksum($enableChecksum->Default);
     # Save the image to disk in JPG format
     $bb->save($dataDir . "barcode.jpg");
     # Print message
     print "Barcode image generated successfully." . PHP_EOL;
 }
 public static function run($dataDir = null)
 {
     # Instantiate barcode object
     $builder = new BarCodeBuilder();
     # Set symbology of the barcode
     $symbology = new Symbology();
     $builder->setSymbologyType($symbology->Code128);
     # Set code text
     $builder->setCodeText("123456");
     # Initialize ByteArrayOutputStream object
     $out_stream = new ByteArrayOutputStream();
     # Save barcode image
     $barCodeImageFormat = new BarCodeImageFormat();
     $builder->save($out_stream, $barCodeImageFormat->Jpeg);
     # Display Status.
     print "Save Barcode Image to Streams, please check the output file." . PHP_EOL;
 }
 public static function run($dataDir = null)
 {
     $bb = new BarCodeBuilder();
     # Set up code text (data to be encoded)
     $bb->setCodeText("1234567");
     # Set the symbology type to Code128
     $symbology = new Symbology();
     $bb->setSymbologyType($symbology->Code128);
     # Set the bar height to be 3 milimeter
     $bb->setBarHeight(3.0);
     $bb->save($dataDir . "barcode3.jpg");
     # Set the bar height to be 7 milimeter
     $bb->setBarHeight(7.0);
     $bb->save($dataDir . "barcode7.jpg");
     # Set the bar height to be 11 milimeter
     $bb->setBarHeight(11.0);
     $bb->save($dataDir . "barcode11.jpg");
     # Display Status.
     print "Barcode with different heights has been created successfully." . PHP_EOL;
 }
 public static function run($dataDir = null)
 {
     # Instantiate barcode object
     $builder = new BarCodeBuilder();
     $symbology = new Symbology();
     $builder->setSymbologyType($symbology->MacroPdf417);
     # Create array for storing multiple barcodes
     $i = 1;
     $size = 4;
     $list_code_text = array("code-1", "code-2", "code-3", "code-last");
     $str_file_id = 1;
     # Check the listbox for getting codetext and generating the barcodes
     for ($i = 1; $i <= $size; $i++) {
         $builder->setCodeText($list_code_text[$i - 1]);
         # fileID should be same for all the generated barcodes
         $builder->setMacroPdf417FileID($str_file_id);
         # Assign segmentID in increasing order (1,2,3,....)
         $builder->setMacroPdf417SegmentID($i);
         # Save the barcode (fileid_segmentid.png)
         $builder->save($dataDir . "#{$i}.png");
     }
     # Display Status
     print "Saved Images Successfully." . PHP_EOL;
 }