def __init__(self): dataDir = Settings.dataDir + 'WorkingWithBarcode/AdvanceBarcodeFeatures/SetBarsHeight' bb = BarCodeBuilder() # Set up code text (data to be encoded) bb.setCodeText("1234567") # Set the symbology type to Code128 symbology = 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."
def __init__(self): dataDir = dataDir = Settings.dataDir + 'WorkingWithBarcode/AdvanceBarcodeFeatures/WideNarrowRatio' # Instantiate barcode object bb = BarCodeBuilder() # Set the code text of the barcode bb.setCodeText("12345678") # Set the symbology type to code39 symbology = 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."
def __init__(self): dataDir = Settings.dataDir + 'WorkingWith2DBarcodes/Utility2DBarcodeFeatures/HideCodeText/' # Instantiate barcode object builder = BarCodeBuilder() symbology = 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 = CodeLocation builder.setCodeLocation(codeLocation.None) font = Font builder.setCodeTextFont(Font("Serif", font.BOLD + font.ITALIC, 20)) # Save the image builder.save(dataDir + "HideCodeText.jpg") # Display Status print "Hide Code Text Successfully."
def __init__(self): dataDir = Settings.dataDir + 'WorkingWith2DBarcodes/Utility2DBarcodeFeatures/GenerateMultipleMacroPdf417Barcodes/' # Instantiate barcode object builder = BarCodeBuilder() symbology= 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 while (i<=size): 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."
def set_appearance(self): dataDir = Settings.dataDir + 'WorkingWithBarcode/UtilityFeatures/CodeText/' bb = BarCodeBuilder() # Set up code text (data to be encoded) bb.setCodeText("1234567") # Set up code text color color = Color bb.setCodeTextColor(color.RED) # Set the location of the code text to above the barcode codeLocation= CodeLocation bb.setCodeLocation(codeLocation.Above) #Increase the space between code text and barcode to 1 point bb.setCodeTextSpace(1.0) # Set the symbology type to Code128 symbology= Symbology bb.setSymbologyType(symbology.Code128) # Save the image to your system and set its image format to Jpeg barCodeImageFormat= BarCodeImageFormat bb.save(dataDir + "barcode.jpg", barCodeImageFormat.Jpeg) # Display Status print "Barcode with custom appearance saved as JPEG image successfully."
def __init__(self): dataDir = Settings.dataDir + 'WorkingWithBarcode/AdvanceBarcodeFeatures/SetBarsHeight' bb = BarCodeBuilder() # Set up code text (data to be encoded) bb.setCodeText("1234567") # Set the symbology type to Code128 symbology = 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."
def set_appearance(self): dataDir = Settings.dataDir + 'WorkingWithBarcode/UtilityFeatures/CodeText/' bb = BarCodeBuilder() # Set up code text (data to be encoded) bb.setCodeText("1234567") # Set up code text color color = Color bb.setCodeTextColor(color.RED) # Set the location of the code text to above the barcode codeLocation = CodeLocation bb.setCodeLocation(codeLocation.Above) #Increase the space between code text and barcode to 1 point bb.setCodeTextSpace(1.0) # Set the symbology type to Code128 symbology = Symbology bb.setSymbologyType(symbology.Code128) # Save the image to your system and set its image format to Jpeg barCodeImageFormat = BarCodeImageFormat bb.save(dataDir + "barcode.jpg", barCodeImageFormat.Jpeg) # Display Status print "Barcode with custom appearance saved as JPEG image successfully."
def __init__(self): dataDir = dataDir = Settings.dataDir + 'WorkingWithBarcode/AdvanceBarcodeFeatures/WideNarrowRatio' # Instantiate barcode object bb = BarCodeBuilder() # Set the code text of the barcode bb.setCodeText("12345678") # Set the symbology type to code39 symbology = 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."
def __init__(self): dataDir = Settings.dataDir + 'WorkingWith2DBarcodes/Basic2DBarcodeFeatures/CreatingDataMatrixBarcode/' # Instantiate barcode object builder = BarCodeBuilder() symbology= Symbology builder.setSymbologyType(symbology.DataMatrix) builder.setCodeText("1234567890") # Save the image to your system and set its image format to Jpeg builder.save(dataDir + "CreatingDataMatrixBarcode.jpg") # Display Status print "Created DataMatrix Barcode Successfully."
def __init__(self): dataDir = Settings.dataDir + 'WorkingWith2DBarcodes/Basic2DBarcodeFeatures/CreatingDataMatrixBarcode/' # Instantiate barcode object builder = BarCodeBuilder() symbology = Symbology builder.setSymbologyType(symbology.DataMatrix) builder.setCodeText("1234567890") # Save the image to your system and set its image format to Jpeg builder.save(dataDir + "CreatingDataMatrixBarcode.jpg") # Display Status print "Created DataMatrix Barcode Successfully."
def __init__(self): dataDir = Settings.dataDir + 'WorkingWithBarcode/AdvanceBarcodeFeatures/PatchCode/' # Instantiate barcode object builder = BarCodeBuilder() # Set Symbology type symbology = 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."
def __init__(self): dataDir = Settings.dataDir + 'WorkingWithBarcode/AdvanceBarcodeFeatures/PatchCode/' # Instantiate barcode object builder = BarCodeBuilder() # Set Symbology type symbology = 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."
def __init__(self): dataDir = Settings.dataDir + 'WorkingWithBarcodeImage/BarcodeImageBasicFeatures/RotateImage' # Instantiate barcode object bb = 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 = Symbology bb.setSymbologyType(symbology.Code39Extended) bb.save(dataDir + "Rotate.jpg"); # Display Status. print "Done with image rotation, please check the output file."
def __init__(self): dataDir = Settings.dataDir + 'WorkingWith2DBarcodes/Utility2DBarcodeFeatures/SetAspectRatio/' # Instantiate barcode object builder = BarCodeBuilder() symbology = 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."
def __init__(self): dataDir = Settings.dataDir + 'WorkingWithBarcodeImage/BarcodeImageBasicFeatures/RotateImage' # Instantiate barcode object bb = 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 = Symbology bb.setSymbologyType(symbology.Code39Extended) bb.save(dataDir + "Rotate.jpg") # Display Status. print "Done with image rotation, please check the output file."
def __init__(self): dataDir = Settings.dataDir + 'WorkingWith2DBarcodes/Utility2DBarcodeFeatures/SetAspectRatio/' # Instantiate barcode object builder = BarCodeBuilder() symbology= 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."
def __init__(self): dataDir = Settings.dataDir + 'WorkingWithBarcodeImage/BarcodeImageUtilityFeatures/CustomizeBarcodeImageResolution/' # Instantiate barcode object bb = BarCodeBuilder() # Set the code text of the barcode bb.setCodeText("12345678") # Set the graphics drawing hint to be Anti Alias imageQualityMode = ImageQualityMode bb.setImageQuality(imageQualityMode.AntiAlias) # Set the symbology type to code39 symbology = Symbology bb.setSymbologyType(symbology.Code39Extended) bb.save(dataDir + "SetBarcodeImageQuality.jpg") # Display Status. print "Set Barcode Image Quality, please check the output file."
def __init__(self): dataDir = Settings.dataDir + 'WorkingWithBarcodeImage/BarcodeImageUtilityFeatures/CustomizeBarcodeImageResolution/' # Instantiate barcode object bb = BarCodeBuilder() # Set the code text of the barcode bb.setCodeText("12345678") # Set the graphics drawing hint to be Anti Alias imageQualityMode = ImageQualityMode bb.setImageQuality(imageQualityMode.AntiAlias) # Set the symbology type to code39 symbology = Symbology bb.setSymbologyType(symbology.Code39Extended) bb.save(dataDir + "SetBarcodeImageQuality.jpg") # Display Status. print "Set Barcode Image Quality, please check the output file."
def set_codetext(self): dataDir = Settings.dataDir + 'WorkingWithBarcode/UtilityFeatures/CodeText/' # Instantiate barcode object bb = BarCodeBuilder() # Set the code text for the barcode bb.setCodeText("Aspose-123") # Set the symbology type to Code128 symbology = 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."
def set_codetext(self): dataDir = Settings.dataDir + 'WorkingWithBarcode/UtilityFeatures/CodeText/' # Instantiate barcode object bb = BarCodeBuilder() # Set the code text for the barcode bb.setCodeText("Aspose-123") # Set the symbology type to Code128 symbology= 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."
def __init__(self): dataDir = Settings.dataDir + 'WorkingWith2DBarcodes/Basic2DBarcodeFeatures/CreatingQRBarcode/' # Instantiate barcode object builder = BarCodeBuilder() symbology= Symbology builder.setSymbologyType(symbology.QR) builder.setCodeText("1234567890") # Hide code text codeLocation= 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."
def __init__(self): dataDir = Settings.dataDir + 'WorkingWithBarcode/AdvanceBarcodeFeatures/ManageDimension/' # Instantiate barcode object bb = BarCodeBuilder() # Set up code text (data to be encoded) bb.setCodeText("1234567") # Set the symbology type to Code128 symbology= 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 = 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."
def __init__(self): dataDir = Settings.dataDir + "WorkingWithBarcodeImage/BarcodeImageUtilityFeatures/SaveBarcodeImageToTtreams/" # Instantiate barcode object builder = BarCodeBuilder() # Set symbology of the barcode symbology = Symbology builder.setSymbologyType(symbology.Code128) # Set code text builder.setCodeText("123456") # Initialize ByteArrayOutputStream object out_stream = ByteArrayOutputStream() # Save barcode image barCodeImageFormat = BarCodeImageFormat builder.save(out_stream, barCodeImageFormat.Jpeg) # Display Status. print "Save Barcode Image to Streams, please check the output file."
def __init__(self): dataDir = Settings.dataDir + 'WorkingWith2DBarcodes/Basic2DBarcodeFeatures/Creating2DBarcode' # Instantiate barcode object builder = BarCodeBuilder() symbology= 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."
def __init__(self): dataDir = Settings.dataDir + 'WorkingWithBarcodeImage/BarcodeImageUtilityFeatures/SaveBarcodeImageToTtreams/' # Instantiate barcode object builder = BarCodeBuilder() # Set symbology of the barcode symbology = Symbology builder.setSymbologyType(symbology.Code128) # Set code text builder.setCodeText("123456") # Initialize ByteArrayOutputStream object out_stream = ByteArrayOutputStream() # Save barcode image barCodeImageFormat = BarCodeImageFormat builder.save(out_stream, barCodeImageFormat.Jpeg) # Display Status. print "Save Barcode Image to Streams, please check the output file."
def __init__(self): dataDir = Settings.dataDir + 'WorkingWithBarcode/AdvanceBarcodeFeatures/UseChecksumAndSupplementData/' # Instantiate barcode object bb = BarCodeBuilder() # Set the Code text for the barcode bb.setCodeText("1234567") # Set the symbology type to Code39 symbology=Symbology bb.setSymbologyType(symbology.Code39Standard) # Make the checksum to be visible on the barcode enableChecksum=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."
def __init__(self): dataDir = Settings.dataDir + "WorkingWithBarcode/UtilityFeatures/ManageCaption/" # Instantiate barcode object bb = BarCodeBuilder() # Set up code text (data to be encoded) bb.setCodeText("1234567") # Set the symbology type to Code128 symbology = Symbology bb.setSymbologyType(symbology.Code128) caption = Caption() alignment = 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(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(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 = BarCodeImageFormat bb.save(dataDir + "barcode.jpg", barCodeImageFormat.Jpeg) # Display Status print "Barcode with Captions saved successfully."
def __init__(self): dataDir = Settings.dataDir + 'WorkingWithBarcode/AdvanceBarcodeFeatures/UseChecksumAndSupplementData/' # Instantiate barcode object bb = BarCodeBuilder() # Set the Code text for the barcode bb.setCodeText("1234567") # Set the symbology type to Code39 symbology = Symbology bb.setSymbologyType(symbology.Code39Standard) # Make the checksum to be visible on the barcode enableChecksum = 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."
def __init__(self): dataDir = Settings.dataDir + 'WorkingWith2DBarcodes/Basic2DBarcodeFeatures/CreatingQRBarcode/' # Instantiate barcode object builder = BarCodeBuilder() symbology = Symbology builder.setSymbologyType(symbology.QR) builder.setCodeText("1234567890") # Hide code text codeLocation = 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."
def __init__(self): dataDir = Settings.dataDir + 'WorkingWithBarcode/UtilityFeatures/ManageCaption/' # Instantiate barcode object bb = BarCodeBuilder() # Set up code text (data to be encoded) bb.setCodeText("1234567") # Set the symbology type to Code128 symbology = Symbology bb.setSymbologyType(symbology.Code128) caption = Caption() alignment = 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(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(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 = BarCodeImageFormat bb.save(dataDir + "barcode.jpg", barCodeImageFormat.Jpeg) # Display Status print "Barcode with Captions saved successfully."
def __init__(self): dataDir = Settings.dataDir + 'WorkingWithBarcode/AdvanceBarcodeFeatures/ManageDimension/' # Instantiate barcode object bb = BarCodeBuilder() # Set up code text (data to be encoded) bb.setCodeText("1234567") # Set the symbology type to Code128 symbology = 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 = 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."
def __init__(self): dataDir = Settings.dataDir + 'WorkingWith2DBarcodes/Basic2DBarcodeFeatures/Creating2DBarcode' # Instantiate barcode object builder = BarCodeBuilder() symbology = 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."
def __init__(self): dataDir = Settings.dataDir + 'WorkingWith2DBarcodes/Utility2DBarcodeFeatures/HideCodeText/' # Instantiate barcode object builder = BarCodeBuilder() symbology= 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= CodeLocation builder.setCodeLocation(codeLocation.None) font = Font builder.setCodeTextFont( Font("Serif", font.BOLD + font.ITALIC, 20)) # Save the image builder.save(dataDir + "HideCodeText.jpg") # Display Status print "Hide Code Text Successfully."