Set BarCode Image Margins in Ruby

Aspose.BarCode - Set Barcode Image Margins

To Set Barcode Image Margins using Aspose.Barcode Java for Ruby, simply invoke SetBarcodeImageMargins module. Here you can see example code.

Ruby Code

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

\# Instantiate barcode object

symbology = Rjb::import('com.aspose.barcode.Symbology')

bb = Rjb::import('com.aspose.barcode.BarCodeBuilder').new("12345678", symbology.Code128)

\# sets the top margin


\# sets the bottom margin


\# sets the left margin


\# sets the right margin

bb.getMargins().setRight(3) + "SetBarcodeImageMargins.jpg")

\# Display Status.

puts "Set Barcode Image Margins, please check the output file."

Download Running Code

Download Set Barcode Image Margins (Aspose.BarCode) from any of the below mentioned social coding sites: