Control the Appearance of Code Text in Ruby

Aspose.BarCode - Control the Appearance of Code Text

To Control the Appearance of Code Text using Aspose.Barcode Java for Ruby, call set_appearance method of CodeText module. Here you can see example code.

Ruby Code

 def set_appearance()

    data_dir = File.dirname(File.dirname(File.dirname(File.dirname(__FILE__)))) + '/data/'

    # Instantiate barcode object

    bb = Rjb::import('com.aspose.barcode.BarCodeBuilder').new

    # Set up code text (data to be encoded)


    # Set up code text color


    # Set the location of the code text to above the barcode


    #Increase the space between code text and barcode to 1 point


    # Set the symbology type to Code128


    # Save the image to your system and set its image format to Jpeg + "barcode.jpg", Rjb::import('com.aspose.barcode.BarCodeImageFormat').Jpeg)

    # Display Status

    puts "Barcode with custom appearance saved as JPEG image successfully."


Download Running Code

Download Control the Appearance of Code Text (Aspose.BarCode) from any of the below mentioned social coding sites: