Beispiel #1
0
    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 + 'WorkingWithBarcodeImage/BarcodeImageBasicFeatures/GenerateBarcodeWithEmptyBars'
        
        # Instantiate barcode object
        symbology = Symbology
        bb = BarCodeBuilder("TEXT", symbology.Code128)

        # Set the FilledBars property to false
        bb.setFilledBars(False)

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

        # Display Status.
        print "Generate Barcode With Empty Bars, please check the output file."
    def __init__(self):
        dataDir = Settings.dataDir + 'WorkingWithBarcode/AdvanceBarcodeFeatures/AustraliaPostBarcode/'
        
        # Instantiate barcode object
        symbology = Symbology
        builder = BarCodeBuilder("1234567890", symbology.AustraliaPost)

        # Set format control code to standard
        australiaPostFormatControlCode=AustraliaPostFormatControlCode
        builder.setAustraliaPostFormatControlCode(australiaPostFormatControlCode.Standard)

        # Save the image to your system and set its image format to Jpeg
        builder.save(dataDir + "AusraliaPost-Barcode.jpg")

        # Display Status
        print "Generated Austrailia Post Barcode Successfully."
    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."
Beispiel #6
0
    def __init__(self):
        dataDir = Settings.dataDir + 'WorkingWithBarcodeImage/BarcodeImageUtilityFeatures/GenerateBarcodeByCustomImageSize/'
        
        # Instantiate barcode object
        symbology = Symbology
        builder = BarCodeBuilder("1234567890", symbology.Code39Standard)

        # Set auto size false
        builder.setAutoSize(False)

        # Set height
        builder.setImageHeight(50)

        # Set width
        builder.setImageWidth(120)

        builder.save(dataDir + "GenerateBarcodeByCustomImageSize.jpg")

        # Display Status.
        print "Generate Barcode By Custom Image Size, please check the output file."
Beispiel #7
0
    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."
Beispiel #9
0
    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 + '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."
Beispiel #13
0
    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 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 + '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."
Beispiel #16
0
    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."
Beispiel #17
0
    def __init__(self):
        dataDir = Settings.dataDir + 'WorkingWithBarcodeImage/BarcodeImageUtilityFeatures/SetBarcodeImageUnitSize/'

        # Instantiate barcode object
        symbology = Symbology
        bb = BarCodeBuilder("12345678", symbology.Code128)

        # Measurement is Milimeter
        graphicsUnit = GraphicsUnit
        bb.setGraphicsUnit(graphicsUnit.Point)

        # Set the bar height to 3 points
        bb.setBarHeight(3.0)

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

        # Display Status.
        print "Set Barcode Image Unit Size, 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."
Beispiel #19
0
    def __init__(self):
        dataDir = Settings.dataDir + 'WorkingWithBarcode/AdvanceBarcodeFeatures/StartStopSymbol/'
        
        # Create instance of BarCodeBuilder, specify codetext and symbology in the constructor
        symbology=Symbology
        builder = BarCodeBuilder(" 123:50", symbology.Codabar)

        # Set the codabar start symbol to A
        codabarSymbol = CodabarSymbol
        builder.setCodabarStartSymbol(codabarSymbol.A)

        # Set the codabar stop symbol to D
        builder.setCodabarStopSymbol(codabarSymbol.D)

        # Save the image to disk in PNG format
        builder.save(dataDir + "barcode.out.png")

        # Print message
        print "Barcode image generated 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 + 'WorkingWithBarcodeImage/BarcodeImageUtilityFeatures/SetBarcodeImageUnitSize/'
        
        # Instantiate barcode object
        symbology = Symbology
        bb = BarCodeBuilder("12345678", symbology.Code128)

        # Measurement is Milimeter
        graphicsUnit = GraphicsUnit
        bb.setGraphicsUnit(graphicsUnit.Point)

        # Set the bar height to 3 points
        bb.setBarHeight(3.0)

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

        # Display Status.
        print "Set Barcode Image Unit Size, please check the output file."
Beispiel #23
0
    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/AustraliaPostBarcode/'

        # Instantiate barcode object
        symbology = Symbology
        builder = BarCodeBuilder("1234567890", symbology.AustraliaPost)

        # Set format control code to standard
        australiaPostFormatControlCode = AustraliaPostFormatControlCode
        builder.setAustraliaPostFormatControlCode(
            australiaPostFormatControlCode.Standard)

        # Save the image to your system and set its image format to Jpeg
        builder.save(dataDir + "AusraliaPost-Barcode.jpg")

        # Display Status
        print "Generated Austrailia Post 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."
Beispiel #26
0
    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 __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."
Beispiel #28
0
    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/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 = 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 + "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/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 = 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 + '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 + 'WorkingWithBarcodeImage/BarcodeImageBasicFeatures/SetBarcodeImageMargins/'

        # Instantiate barcode object
        symbology = Symbology
        bb = BarCodeBuilder("12345678", symbology.Code128)

        # sets the top margin
        bb.getMargins().setTop(4)

        # sets the bottom margin
        bb.getMargins().setBottom(5)

        # sets the left margin
        bb.getMargins().setLeft(2)

        # sets the right margin
        bb.getMargins().setRight(3)

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

        # Display Status.
        print "Set Barcode Image Margins, please check the output file."
Beispiel #36
0
    def __init__(self):
        dataDir = Settings.dataDir + 'WorkingWithBarcode/UtilityFeatures/SpecifySymbologies'

        builder = BarCodeBuilder()

        # ============ Code39Standard =====================
        # set symbology type
        symbology = 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."
Beispiel #37
0
    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."
Beispiel #38
0
    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 = Settings.dataDir + 'WorkingWithBarcodeImage/BarcodeImageBasicFeatures/SetBarcodeImageBorders/'
        
        # Instantiate barcode object
        bb = BarCodeBuilder()

        margins = MarginsF()
        # 6 milimeter space from left, right, top and bottom side of border
        margins.setLeft(2)
        margins.setRight(2)
        margins.setTop(2)
        margins.setBottom(2)

        # Set border's width to be 0.5 milimeter
        bb.setBorderWidth(0.5)

        # Border will be visible
        bb.setBorderVisible(True)

        # Set the border's color to red
        color=Color
        bb.setBorderColor(color.RED)

        # Set margins
        bb.setMargins(margins)

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

        # Display Status.
        print "Set border margins, please check the output file."
    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 + '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/SpecifySymbologies'
        
        builder = BarCodeBuilder()

        # ============ Code39Standard =====================
        # set symbology type
        symbology=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."
    def __init__(self):
        dataDir = Settings.dataDir + 'WorkingWithBarcodeImage/BarcodeImageBasicFeatures/SetBarcodeImageBorders/'

        # Instantiate barcode object
        bb = BarCodeBuilder()

        margins = MarginsF()
        # 6 milimeter space from left, right, top and bottom side of border
        margins.setLeft(2)
        margins.setRight(2)
        margins.setTop(2)
        margins.setBottom(2)

        # Set border's width to be 0.5 milimeter
        bb.setBorderWidth(0.5)

        # Border will be visible
        bb.setBorderVisible(True)

        # Set the border's color to red
        color = Color
        bb.setBorderColor(color.RED)

        # Set margins
        bb.setMargins(margins)

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

        # Display Status.
        print "Set border margins, please check the output file."
    def __init__(self):
        dataDir = Settings.dataDir + 'WorkingWithBarcodeImage/BarcodeImageBasicFeatures/SetBarcodeImageMargins/'
        
        # Instantiate barcode object
        symbology = Symbology
        bb = BarCodeBuilder("12345678", symbology.Code128)

        # sets the top margin
        bb.getMargins().setTop(4)

        # sets the bottom margin
        bb.getMargins().setBottom(5)

        # sets the left margin
        bb.getMargins().setLeft(2)

        # sets the right margin
        bb.getMargins().setRight(3)

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

        # Display Status.
        print "Set Barcode Image Margins, please check the output file."
    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 + '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 + '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."