Class: Zint::Barcode
- Inherits:
-
Object
- Object
- Zint::Barcode
- Defined in:
- lib/zint/barcode.rb
Overview
Base class to represent the barcode
Direct Known Subclasses
AusPost, AusRedirect, AusReply, AusRoute, Azrune, Aztec, Bc412, C25iata, C25ind, C25inter, C25logic, C25matrix, C25standard, CepNet, Channel, Codabar, CodablockF, Code11, Code128, Code128AB, Code16k, Code32, Code39, Code49, Code93, CodeOne, Daft, DataMatrix, DbarExp, DbarExpstk, DbarLtd, DbarOmn, DbarOmnstk, DbarStk, DotCode, Dpd, Dpident, Dpleit, Ean128, Ean14, Eanx, EanxChk, Excode39, Fim, Flat, GridMatrix, Gs1_128, Hanxin, Hibc128, Hibc39, HibcAztec, HibcBlockf, HibcDm, HibcMicpdf, HibcPdf, HibcQr, Isbnx, Itf14, JapanPost, Kix, KoreaPost, Logmars, Mailmark, Mailmark2D, Mailmark4S, MaxiCode, MicroPdf417, MicroQr, MsiPlessey, Nve18, OneCode, Pdf417, Pdf417comp, Pdf417trunc, Pharma, PharmaTwo, Planet, Plessey, Postnet, Pzn, Qr, Rmqr, Rss14, Rss14stack, Rss14stackOmni, RssExp, RssExpstack, RssLtd, Telepen, TelepenNum, Ultra, UpcA, UpcAChk, UpcE, UpcEChk, Upnqr, UpuS10, UspsImail, Vin
Defined Under Namespace
Classes: AlreadyGenerated
Instance Attribute Summary collapse
-
#input_file ⇒ String, NilClass
Path to input file with content of the barcode.
-
#value ⇒ String, NilClass
Content of the barcode.
Instance Method Summary collapse
-
#bgcolour ⇒ Object
Gets background colour of barcode.
-
#bgcolour=(bgcolour) ⇒ Object
Sets background as RGB/RGBA hexadecimal string, 6 or 8 characters, NUL-terminated.
-
#bitmap_byte_length ⇒ Object
Gets bitmap byte length of barcode.
-
#bitmap_height ⇒ Object
Gets bitmap height of barcode.
-
#bitmap_width ⇒ Object
Gets bitmap width of barcode.
-
#border_width ⇒ Object
Gets size of border in X-dimensions.
-
#border_width=(border_width) ⇒ Object
Sets size of border in X-dimensions.
-
#debug ⇒ Object
Gets debugging flags.
-
#debug=(debug) ⇒ Object
Sets debugging flags.
-
#dot_size ⇒ Object
Gets dot size of barcode.
-
#dot_size=(dot_size) ⇒ Object
Sets size of dots used in BARCODE_DOTTY_MODE.
-
#dpmm ⇒ Object
Gets resolution of output in dots per mm (BMP/EMF/PCX/PNG/TIF only).
-
#dpmm=(dpmm) ⇒ Object
Sets resolution of output in dots per mm (BMP/EMF/PCX/PNG/TIF only).
-
#eci ⇒ Object
Gets ECI of barcode.
-
#eci=(eci) ⇒ Object
Sets extended Channel Interpretation.
-
#encode ⇒ Object
Encodes the symbology without exporting to a bitmap or vector data.
-
#encoded_data_as_array_of_strings ⇒ Array<String>
Return the raw encoded data as array of strings.
-
#encoded_data_raw_ffi ⇒ Object
Gets encoded data of barcode as internal FFI::StructLayout::CharArray object.
-
#errtxt ⇒ Object
Gets error message in the event that an error occurred.
-
#fgcolour ⇒ Object
Gets foreground colour of barcode.
-
#fgcolour=(fgcolour) ⇒ Object
Sets foreground as RGB/RGBA hexadecimal string, 6 or 8 characters, NUL-terminated.
-
#fontsize ⇒ Object
Gets font size of barcode.
-
#fontsize=(fontsize) ⇒ Object
Sets font size of barcode (Unused).
-
#free ⇒ Object
Free barcode and all memory associated with it.
-
#guard_descent ⇒ Object
Gets height in X-dimensions that EAN/UPC guard bars descend.
-
#guard_descent=(guard_descent) ⇒ Object
Sets height in X-dimensions that EAN/UPC guard bars descend.
-
#height ⇒ Object
Gets height of barcode.
-
#height=(height) ⇒ Object
Sets height in X-dimensions (ignored for fixed-width barcodes).
-
#initialize(value: nil, input_file: nil, symbology: Zint::BARCODE_CODE128, **kwargs) ⇒ Barcode
constructor
A new instance of Barcode.
-
#input_mode ⇒ Object
Gets input mode of barcode.
-
#input_mode=(input_mode) ⇒ Object
Sets encoding of input data (see DATA_MODE etc below).
-
#option_1 ⇒ Object
Gets option 1 of barcode.
-
#option_1=(option_1) ⇒ Object
Sets option 1 (symbol-specific options (see “../docs/manual.txt”)).
-
#option_2 ⇒ Object
Gets option 2 of barcode.
-
#option_2=(option_2) ⇒ Object
Sets option 2 (symbol-specific options) of barcode.
-
#option_3 ⇒ Object
Gets option 3 of barcode.
-
#option_3=(option_3) ⇒ Object
Sets option 3 (symbol-specific options) of barcode.
-
#outfile ⇒ Object
Contains the name of the file to output a resulting barcode symbol to.
-
#output_options ⇒ Object
Gets output options of barcode.
-
#output_options=(output_options) ⇒ Object
Set various output parameters (bind, box etc, see below) of barcode.
-
#primary ⇒ Object
Gets primary message data for more complex symbols.
-
#primary=(primary) ⇒ Object
Sets primary message data (MaxiCode, Composite), NUL-terminated of barcode.
-
#row_height_raw_ffi ⇒ Object
Gets row heights of barcode as internal FFI::Struct::InlineArray object.
-
#row_heights ⇒ Array<Float>
Gets heights of all barcode rows.
-
#rows ⇒ Object
Gets rows of barcode.
-
#scale ⇒ Object
Gets scale factor of barcode.
-
#scale=(scale) ⇒ Object
Sets scale factor when printing barcode.
-
#show_hrt ⇒ Object
Gets show_hrt of barcode.
-
#show_hrt=(show_hrt) ⇒ Object
Sets show_hrt of barcode show = 1 or hide = 0 Human Readable Text.
-
#structapp ⇒ Object
Gets structured append info.
-
#structapp=(structapp) ⇒ Object
Sets structured append info.
-
#symbology ⇒ Object
Gets type of barcode.
-
#symbology=(type) ⇒ Object
Sets symbol to use (see BARCODE_XXX below).
-
#text ⇒ Object
Human Readable Text, which usually consists of input data plus one more check digit.
-
#to_bitmap(rotate_angle: 0) ⇒ Zint::Bitmap
Exports barcode to buffer.
-
#to_buffer(rotate_angle: 0) ⇒ String
Exports barcode to buffer.
-
#to_file(path:, rotate_angle: 0) ⇒ Object
Exports barcode to file.
-
#to_memory_file(extension: ".png", rotate_angle: 0) ⇒ String
Exports barcode to memory file.
-
#to_vector(rotate_angle: 0) ⇒ Zint::Structs::Vector
Exports barcode as Zint vector.
-
#warn_level ⇒ Object
Gets warn level of barcode.
-
#warn_level=(warn_level) ⇒ Object
Sets warn level (affects error/warning value returned by Zint API (see WARN_XXX below)) of barcode.
-
#whitespace_height ⇒ Object
Gets height in X-dimensions of whitespace above & below the barcode.
-
#whitespace_height=(whitespace_height) ⇒ Object
Sets height in X-dimensions of whitespace above & below the barcode.
-
#whitespace_width ⇒ Object
Gets width in X-dimensions of whitespace to left & right of barcode.
-
#whitespace_width=(whitespace_width) ⇒ Object
Sets width in X-dimensions of whitespace to left & right of barcode.
-
#width ⇒ Object
Gets width of barcode.
Constructor Details
#initialize(value: nil, input_file: nil, symbology: Zint::BARCODE_CODE128, **kwargs) ⇒ Barcode
Returns a new instance of Barcode.
21 22 23 24 25 26 27 28 29 30 31 32 33 |
# File 'lib/zint/barcode.rb', line 21 def initialize(value: nil, input_file: nil, symbology: Zint::BARCODE_CODE128, **kwargs) raise ArgumentError, "value or input_file must be given!" if value&.empty? && input_file&.empty? raise ArgumentError, "input_file not found!" if input_file && !File.exist?(input_file) @zint_symbol = Native.ZBarcode_Create self.symbology = symbology kwargs.each do |k, v| send(:"#{k}=", v) end @value = value @input_file = input_file end |
Instance Attribute Details
#input_file ⇒ String, NilClass
Returns Path to input file with content of the barcode.
15 16 17 |
# File 'lib/zint/barcode.rb', line 15 def input_file @input_file end |
#value ⇒ String, NilClass
Returns Content of the barcode.
13 14 15 |
# File 'lib/zint/barcode.rb', line 13 def value @value end |
Instance Method Details
#bgcolour ⇒ Object
Gets background colour of barcode
250 251 252 |
# File 'lib/zint/barcode.rb', line 250 def bgcolour @zint_symbol[:bgcolour].to_s end |
#bgcolour=(bgcolour) ⇒ Object
Sets background as RGB/RGBA hexadecimal string, 6 or 8 characters, NUL-terminated
257 258 259 |
# File 'lib/zint/barcode.rb', line 257 def bgcolour=(bgcolour) @zint_symbol[:bgcolour] = bgcolour end |
#bitmap_byte_length ⇒ Object
Gets bitmap byte length of barcode
483 484 485 |
# File 'lib/zint/barcode.rb', line 483 def bitmap_byte_length @zint_symbol[:bitmap_byte_length] end |
#bitmap_height ⇒ Object
Gets bitmap height of barcode
478 479 480 |
# File 'lib/zint/barcode.rb', line 478 def bitmap_height @zint_symbol[:bitmap_height] end |
#bitmap_width ⇒ Object
Gets bitmap width of barcode
473 474 475 |
# File 'lib/zint/barcode.rb', line 473 def bitmap_width @zint_symbol[:bitmap_width] end |
#border_width ⇒ Object
Gets size of border in X-dimensions
214 215 216 |
# File 'lib/zint/barcode.rb', line 214 def border_width @zint_symbol[:border_width] end |
#border_width=(border_width) ⇒ Object
Sets size of border in X-dimensions
221 222 223 |
# File 'lib/zint/barcode.rb', line 221 def border_width=(border_width) @zint_symbol[:border_width] = border_width end |
#debug ⇒ Object
Gets debugging flags
500 501 502 |
# File 'lib/zint/barcode.rb', line 500 def debug @zint_symbol[:debug] end |
#debug=(debug) ⇒ Object
Sets debugging flags
507 508 509 |
# File 'lib/zint/barcode.rb', line 507 def debug=(debug) @zint_symbol[:debug] = debug end |
#dot_size ⇒ Object
Gets dot size of barcode
488 489 490 |
# File 'lib/zint/barcode.rb', line 488 def dot_size @zint_symbol[:dot_size] end |
#dot_size=(dot_size) ⇒ Object
Sets size of dots used in BARCODE_DOTTY_MODE
495 496 497 |
# File 'lib/zint/barcode.rb', line 495 def dot_size=(dot_size) @zint_symbol[:dot_size] = dot_size end |
#dpmm ⇒ Object
Gets resolution of output in dots per mm (BMP/EMF/PCX/PNG/TIF only). Default 0 (none)
354 355 356 |
# File 'lib/zint/barcode.rb', line 354 def dpmm @zint_symbol[:dpmm] end |
#dpmm=(dpmm) ⇒ Object
Sets resolution of output in dots per mm (BMP/EMF/PCX/PNG/TIF only). Default 0 (none)
361 362 363 |
# File 'lib/zint/barcode.rb', line 361 def dpmm=(dpmm) @zint_symbol[:dpmm] = dpmm end |
#eci ⇒ Object
Gets ECI of barcode
342 343 344 |
# File 'lib/zint/barcode.rb', line 342 def eci @zint_symbol[:eci] end |
#eci=(eci) ⇒ Object
Sets extended Channel Interpretation. Default 0 (none)
349 350 351 |
# File 'lib/zint/barcode.rb', line 349 def eci=(eci) @zint_symbol[:eci] = eci end |
#encode ⇒ Object
Encodes the symbology without exporting to a bitmap or vector data
This method fills the output accessors of the Zint::Barcode object.
134 135 136 137 138 139 140 141 |
# File 'lib/zint/barcode.rb', line 134 def encode if input_file call_function(:ZBarcode_Encode_File, @zint_symbol, input_file) else call_function(:ZBarcode_Encode, @zint_symbol, value, value.bytesize) end self end |
#encoded_data_as_array_of_strings ⇒ Array<String>
Return the raw encoded data as array of strings.
Each row of the symbology is represented by one item of the array. The columns are represented by “0” and “1” characters of the stings.
442 443 444 445 446 447 |
# File 'lib/zint/barcode.rb', line 442 def encoded_data_as_array_of_strings rows.times.map do |row| binstr = @zint_symbol[:encoded_data].to_ptr.get_bytes(144 * row, (width + 7) / 8) binstr.unpack1("b*")[0, width] end end |
#encoded_data_raw_ffi ⇒ Object
Gets encoded data of barcode as internal FFI::StructLayout::CharArray object
Don’t use this method, it might be changed in future releases.
419 420 421 |
# File 'lib/zint/barcode.rb', line 419 def encoded_data_raw_ffi @zint_symbol[:encoded_data] end |
#errtxt ⇒ Object
Gets error message in the event that an error occurred
468 469 470 |
# File 'lib/zint/barcode.rb', line 468 def errtxt @zint_symbol[:errtxt].to_s.force_encoding(Encoding::UTF_8) end |
#fgcolour ⇒ Object
Gets foreground colour of barcode
238 239 240 |
# File 'lib/zint/barcode.rb', line 238 def fgcolour @zint_symbol[:fgcolour].to_s end |
#fgcolour=(fgcolour) ⇒ Object
Sets foreground as RGB/RGBA hexadecimal string, 6 or 8 characters, NUL-terminated
245 246 247 |
# File 'lib/zint/barcode.rb', line 245 def fgcolour=(fgcolour) @zint_symbol[:fgcolour] = fgcolour end |
#fontsize ⇒ Object
Gets font size of barcode
318 319 320 |
# File 'lib/zint/barcode.rb', line 318 def fontsize @zint_symbol[:fontsize] end |
#fontsize=(fontsize) ⇒ Object
Sets font size of barcode (Unused)
325 326 327 |
# File 'lib/zint/barcode.rb', line 325 def fontsize=(fontsize) @zint_symbol[:fontsize] = fontsize end |
#free ⇒ Object
Free barcode and all memory associated with it.
Note: This method is dangerous insofar, that previously exported vectors (by #to_vector ) are no longer usable and any access to them will result in a segfault. It is better to not call this method and leave cleaning up to the garbage collector.
147 148 149 |
# File 'lib/zint/barcode.rb', line 147 def free @zint_symbol.pointer.free end |
#guard_descent ⇒ Object
Gets height in X-dimensions that EAN/UPC guard bars descend. Default 5
366 367 368 |
# File 'lib/zint/barcode.rb', line 366 def guard_descent @zint_symbol[:guard_descent] end |
#guard_descent=(guard_descent) ⇒ Object
Sets height in X-dimensions that EAN/UPC guard bars descend. Default 5
373 374 375 |
# File 'lib/zint/barcode.rb', line 373 def guard_descent=(guard_descent) @zint_symbol[:guard_descent] = guard_descent end |
#height ⇒ Object
Gets height of barcode
166 167 168 |
# File 'lib/zint/barcode.rb', line 166 def height @zint_symbol[:height] end |
#height=(height) ⇒ Object
Sets height in X-dimensions (ignored for fixed-width barcodes)
173 174 175 |
# File 'lib/zint/barcode.rb', line 173 def height=(height) @zint_symbol[:height] = height end |
#input_mode ⇒ Object
Gets input mode of barcode
330 331 332 |
# File 'lib/zint/barcode.rb', line 330 def input_mode @zint_symbol[:input_mode] end |
#input_mode=(input_mode) ⇒ Object
Sets encoding of input data (see DATA_MODE etc below). Default DATA_MODE
337 338 339 |
# File 'lib/zint/barcode.rb', line 337 def input_mode=(input_mode) @zint_symbol[:input_mode] = input_mode end |
#option_1 ⇒ Object
Gets option 1 of barcode
269 270 271 |
# File 'lib/zint/barcode.rb', line 269 def option_1 @zint_symbol[:option_1] end |
#option_1=(option_1) ⇒ Object
Sets option 1 (symbol-specific options (see “../docs/manual.txt”))
276 277 278 |
# File 'lib/zint/barcode.rb', line 276 def option_1=(option_1) @zint_symbol[:option_1] = option_1 end |
#option_2 ⇒ Object
Gets option 2 of barcode
281 282 283 |
# File 'lib/zint/barcode.rb', line 281 def option_2 @zint_symbol[:option_2] end |
#option_2=(option_2) ⇒ Object
Sets option 2 (symbol-specific options) of barcode
288 289 290 |
# File 'lib/zint/barcode.rb', line 288 def option_2=(option_2) @zint_symbol[:option_2] = option_2 end |
#option_3 ⇒ Object
Gets option 3 of barcode
293 294 295 |
# File 'lib/zint/barcode.rb', line 293 def option_3 @zint_symbol[:option_3] end |
#option_3=(option_3) ⇒ Object
Sets option 3 (symbol-specific options) of barcode
300 301 302 |
# File 'lib/zint/barcode.rb', line 300 def option_3=(option_3) @zint_symbol[:option_3] = option_3 end |
#outfile ⇒ Object
Contains the name of the file to output a resulting barcode symbol to.
Must end in .png, .gif, .bmp, .emf, .eps, .pcx, .svg, .tif or .txt
264 265 266 |
# File 'lib/zint/barcode.rb', line 264 def outfile @zint_symbol[:outfile].to_s end |
#output_options ⇒ Object
Gets output options of barcode
226 227 228 |
# File 'lib/zint/barcode.rb', line 226 def @zint_symbol[:output_options] end |
#output_options=(output_options) ⇒ Object
Set various output parameters (bind, box etc, see below) of barcode
233 234 235 |
# File 'lib/zint/barcode.rb', line 233 def () @zint_symbol[:output_options] = end |
#primary ⇒ Object
Gets primary message data for more complex symbols
405 406 407 |
# File 'lib/zint/barcode.rb', line 405 def primary @zint_symbol[:primary].to_s end |
#primary=(primary) ⇒ Object
Sets primary message data (MaxiCode, Composite), NUL-terminated of barcode
412 413 414 |
# File 'lib/zint/barcode.rb', line 412 def primary=(primary) @zint_symbol[:primary] = primary end |
#row_height_raw_ffi ⇒ Object
Gets row heights of barcode as internal FFI::Struct::InlineArray object
Don’t use this method, it might be changed in future releases.
452 453 454 |
# File 'lib/zint/barcode.rb', line 452 def row_height_raw_ffi @zint_symbol[:row_height] end |
#row_heights ⇒ Array<Float>
Gets heights of all barcode rows
463 464 465 |
# File 'lib/zint/barcode.rb', line 463 def row_heights @zint_symbol[:row_height].to_a[0, rows] end |
#rows ⇒ Object
Gets rows of barcode
395 396 397 |
# File 'lib/zint/barcode.rb', line 395 def rows @zint_symbol[:rows] end |
#scale ⇒ Object
Gets scale factor of barcode
178 179 180 |
# File 'lib/zint/barcode.rb', line 178 def scale @zint_symbol[:scale] end |
#scale=(scale) ⇒ Object
Sets scale factor when printing barcode
185 186 187 |
# File 'lib/zint/barcode.rb', line 185 def scale=(scale) @zint_symbol[:scale] = scale end |
#show_hrt ⇒ Object
Gets show_hrt of barcode
305 306 307 |
# File 'lib/zint/barcode.rb', line 305 def show_hrt @zint_symbol[:show_hrt] end |
#show_hrt=(show_hrt) ⇒ Object
Sets show_hrt of barcode show = 1 or hide = 0 Human Readable Text. Default is show (1)
313 314 315 |
# File 'lib/zint/barcode.rb', line 313 def show_hrt=(show_hrt) @zint_symbol[:show_hrt] = show_hrt end |
#structapp ⇒ Object
Gets structured append info. Default structapp.count 0 (none)
378 379 380 |
# File 'lib/zint/barcode.rb', line 378 def structapp @zint_symbol[:structapp] end |
#structapp=(structapp) ⇒ Object
Sets structured append info. Default structapp.count 0 (none)
385 386 387 |
# File 'lib/zint/barcode.rb', line 385 def structapp=(structapp) @zint_symbol[:structapp] = structapp end |
#symbology ⇒ Object
Gets type of barcode
154 155 156 |
# File 'lib/zint/barcode.rb', line 154 def symbology @zint_symbol[:symbology] end |
#symbology=(type) ⇒ Object
Sets symbol to use (see BARCODE_XXX below)
161 162 163 |
# File 'lib/zint/barcode.rb', line 161 def symbology=(type) @zint_symbol[:symbology] = type end |
#text ⇒ Object
Human Readable Text, which usually consists of input data plus one more check digit. Uses UTF-8 formatting.
390 391 392 |
# File 'lib/zint/barcode.rb', line 390 def text @zint_symbol[:text].to_s.force_encoding(Encoding::UTF_8) end |
#to_bitmap(rotate_angle: 0) ⇒ Zint::Bitmap
Exports barcode to buffer
96 97 98 99 100 101 102 103 104 105 106 107 |
# File 'lib/zint/barcode.rb', line 96 def to_bitmap(rotate_angle: 0) zint_bitmap = to_buffer(rotate_angle: rotate_angle) pixels = [] @zint_symbol[:bitmap_height].times do |row| @zint_symbol[:bitmap_width].times do |column| pixels << BitmapPixel.new(column, row, zint_bitmap[pixels.size]) end end Bitmap.new(@zint_symbol[:bitmap_width], @zint_symbol[:bitmap_height], pixels) end |
#to_buffer(rotate_angle: 0) ⇒ String
Exports barcode to buffer
77 78 79 80 81 82 83 84 85 86 87 88 89 90 |
# File 'lib/zint/barcode.rb', line 77 def to_buffer(rotate_angle: 0) unless @zint_symbol[:bitmap].null? raise AlreadyGenerated, "to_vector was already executed" end @zint_symbol[:output_options] = Zint::OUT_BUFFER_INTERMEDIATE if input_file call_function(:ZBarcode_Encode_File_and_Buffer, @zint_symbol, input_file, rotate_angle) else call_function(:ZBarcode_Encode_and_Buffer, @zint_symbol, value, value.bytesize, rotate_angle) end @zint_symbol[:bitmap].read_bytes((@zint_symbol[:bitmap_width] * @zint_symbol[:bitmap_height])) end |
#to_file(path:, rotate_angle: 0) ⇒ Object
Exports barcode to file
41 42 43 44 45 46 47 48 49 50 51 52 |
# File 'lib/zint/barcode.rb', line 41 def to_file(path:, rotate_angle: 0) unless outfile == "out.png" raise AlreadyGenerated, "to_file was already executed" end @zint_symbol[:outfile] = path if input_file call_function(:ZBarcode_Encode_File_and_Print, @zint_symbol, input_file, rotate_angle) else call_function(:ZBarcode_Encode_and_Print, @zint_symbol, value, value.bytesize, rotate_angle) end end |
#to_memory_file(extension: ".png", rotate_angle: 0) ⇒ String
Exports barcode to memory file
59 60 61 62 63 64 65 66 67 68 69 70 71 |
# File 'lib/zint/barcode.rb', line 59 def to_memory_file(extension: ".png", rotate_angle: 0) require "tempfile" file = Tempfile.new(["zint", extension]) to_file(path: file.path, rotate_angle: rotate_angle) file.rewind buffer = file.read file.close file.unlink buffer end |
#to_vector(rotate_angle: 0) ⇒ Zint::Structs::Vector
Exports barcode as Zint vector
113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 |
# File 'lib/zint/barcode.rb', line 113 def to_vector(rotate_angle: 0) unless @zint_symbol[:vector].pointer.null? raise AlreadyGenerated, "to_vector was already executed" end if input_file call_function(:ZBarcode_Encode_File_and_Buffer_Vector, @zint_symbol, input_file, rotate_angle) else call_function(:ZBarcode_Encode_and_Buffer_Vector, @zint_symbol, value, value.bytesize, rotate_angle) end v = @zint_symbol[:vector] # Avoid garbage collection of Symbol before Vector, since the Vector is also freed by ZBarcode_Delete() v.instance_variable_set(:@symbol, @zint_symbol) v end |
#warn_level ⇒ Object
Gets warn level of barcode
512 513 514 |
# File 'lib/zint/barcode.rb', line 512 def warn_level @zint_symbol[:warn_level] end |
#warn_level=(warn_level) ⇒ Object
Sets warn level (affects error/warning value returned by Zint API (see WARN_XXX below)) of barcode
519 520 521 |
# File 'lib/zint/barcode.rb', line 519 def warn_level=(warn_level) @zint_symbol[:warn_level] = warn_level end |
#whitespace_height ⇒ Object
Gets height in X-dimensions of whitespace above & below the barcode
202 203 204 |
# File 'lib/zint/barcode.rb', line 202 def whitespace_height @zint_symbol[:whitespace_height] end |
#whitespace_height=(whitespace_height) ⇒ Object
Sets height in X-dimensions of whitespace above & below the barcode
209 210 211 |
# File 'lib/zint/barcode.rb', line 209 def whitespace_height=(whitespace_height) @zint_symbol[:whitespace_height] = whitespace_height end |
#whitespace_width ⇒ Object
Gets width in X-dimensions of whitespace to left & right of barcode
190 191 192 |
# File 'lib/zint/barcode.rb', line 190 def whitespace_width @zint_symbol[:whitespace_width] end |
#whitespace_width=(whitespace_width) ⇒ Object
Sets width in X-dimensions of whitespace to left & right of barcode
197 198 199 |
# File 'lib/zint/barcode.rb', line 197 def whitespace_width=(whitespace_width) @zint_symbol[:whitespace_width] = whitespace_width end |
#width ⇒ Object
Gets width of barcode
400 401 402 |
# File 'lib/zint/barcode.rb', line 400 def width @zint_symbol[:width] end |