Method: Aspose::Cloud::Barcode::Reader#read_with_checksum
- Defined in:
- lib/Barcode/reader.rb
#read_with_checksum(symbology, checksumValidation) ⇒ Object
Recognize Barcode with Checksum Option from Storage
@param string symbology Type of barcode.
@param string checksumValidation Sets checksum validation parameter.
108 109 110 111 112 113 114 115 116 117 118 119 |
# File 'lib/Barcode/reader.rb', line 108 def read_with_checksum(symbology, checksumValidation) raise 'Symbology not provided.' if symbology.empty? raise 'Checksum not provided.' if checksumValidation.empty? str_uri = "#{Aspose::Cloud::Common::Product.product_uri}/barcode/#{@filename}/recognize" str_uri = "#{str_uri}?type=#{symbology}&checksumValidation=#{checksumValidation}" signed_uri = Aspose::Cloud::Common::Utils.sign(str_uri) response = RestClient.get(signed_uri, {:accept => 'application/json'}) json = JSON.parse(response) json['Code'] == 200 ? json['Barcodes'] : nil end |