def __init__(self):
        dataDir = Settings.dataDir + 'WorkingWithBarcodeImage/BarcodeImageBasicFeatures/SetBarcodeImageColor/'
        
        # Instantiate barcode object
        bb = BarCodeBuilder()

        color = Color

        # Set the background color of the barcode
        bb.setBackColor(color.YELLOW)

        # Set the foreground color of the barcode
        bb.setForeColor(color.BLUE)

        # Set border's color
        bb.setBorderColor(color.RED)

        # Set the code text's color
        bb.setCodeTextColor(color.RED)

        # Caption's color
        bb.getCaptionAbove().setForeColor(color.darkGray)
        bb.getCaptionBelow().setForeColor(color.CYAN)

        bb.save(dataDir + "color.jpg")

        # Display Status.
        print "Applied color to barcode image, please check the output file."
    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/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."