Thanks for downloading Dynamsoft Barcode Reader Package!
Your download will start shortly. If your download does not begin, click here to retry.
Method | Description |
---|---|
initRuntimeSettingsWithFile |
Initialize runtime settings with the settings in a given JSON file. |
initRuntimeSettingsWithString |
Initialize runtime settings with the settings in a given JSON string. |
appendTplFileToRuntimeSettings |
Append a new template file to the current runtime settings. |
appendTplStringToRuntimeSettings |
Append a new template string to the current runtime settings. |
allParameterTemplateNames |
Gets the parameter templates name array. |
outputSettingsToFile |
Output runtime settings to a settings file (JSON file). |
outputSettingsToString |
Output runtime settings to a string. |
Initialize runtime settings with the parameters obtained from a JSON file.
- (void)initRuntimeSettingsWithFile:(NSString* _Nonnull)fileName
conflictMode:(EnumConflictMode)conflictMode
error:(NSError* _Nullable * _Nullable)error;
Parameters
[in] fileName
The settings file path.
[in] conflictMode
The parameter setting mode, which decides whether to inherit parameters from previous template settings or to overwrite previous settings with the new template.
[in,out] error
Input a pointer to an error object. If an error occurs, this pointer is set to an actual error object containing the error information. You may specify nil for this parameter if you do not want the error information.
Code Snippet
Objective-C:
NSError __autoreleasing * _Nullable error;
[barcodeReader initRuntimeSettingsWithFile:@"your template file path" conflictMode:EnumConflictModeOverwrite error:&error];
Swift:
let error: NSError? = NSError()
barcodeReader.initRuntimeSettingsWithFile(fileName:"your template file path", conflictMode:EnumConflictMode.overwrite, error:&error)
Initialize runtime settings with the parameters obtained from a JSON string.
- (void)initRuntimeSettingsWithString:(NSString* _Nonnull)content
conflictMode:(EnumConflictMode)conflictMode
error:(NSError* _Nullable * _Nullable)error;
Parameters
[in] content
A JSON string that represents the content of the settings.
[in] conflictMode
The parameter setting mode, which decides whether to inherit parameters from previous template setting or to overwrite previous settings with the new template.
[in,out] error
Input a pointer to an error object. If an error occurs, this pointer is set to an actual error object containing the error information. You may specify nil for this parameter if you do not want the error information.
Code Snippet
Objective-C:
NSError __autoreleasing * _Nullable error;
[barcodeReader initRuntimeSettingsWithString:@"{\"Version\":\"3.0\", \"ImageParameter\":{\"Name\":\"IP1\", \"BarcodeFormatIds\":[\"BF_QR_CODE\"], \"ExpectedBarcodesCount\":10}}" conflictMode:EnumConflictModeOverwrite error:&error];
Swift:
let error: NSError? = NSError()
barcodeReader.initRuntimeSettingsWithString(content:"{\"Version\":\"3.0\", \"ImageParameter\":{\"Name\":\"IP1\", \"BarcodeFormatIds\":[\"BF_QR_CODE\"], \"ExpectedBarcodesCount\":10}}", conflictMode:EnumConflictMode.overwrite, error:&error)
Append a new template file to the current runtime settings.
- (void)appendTplFileToRuntimeSettings:(NSString * _Nonnull)fileName
conflictMode:(EnumConflictMode)conflictMode
error:(NSError * _Nullable *_Nullable)error;
Parameters
[in] fileName
The settings file path.
[in] conflictMode
The parameter setting mode, which decides whether to inherit parameters from previous template settings or to overwrite previous settings with the new template.
[in,out] error
Input a pointer to an error object. If an error occurs, this pointer is set to an actual error object containing the error information. You may specify nil for this parameter if you do not want the error information.
Code Snippet
Objective-C:
NSError __autoreleasing * _Nullable error;
[barcodeReader appendTplFileToRuntimeSettings:@"your template file path" conflictMode:EnumConflictModeIgnore error:&error];
Swift:
let error: NSError? = NSError()
barcodeReader.appendTplFileToRuntimeSettings(fileName:"your template file path", conflictMode:EnumConflictMode.ignore, error:&error)
Append a new template string to the current runtime settings.
- (void)appendTplStringToRuntimeSettings:(NSString * _Nonnull)content
conflictMode:(EnumConflictMode)conflictMode
error:(NSError *_Nullable *_Nullable)error;
Parameters
[in] content
A JSON string that represents the content of the settings.
[in] conflictMode
The parameter setting mode, which decides whether to inherit parameters from previous template setting or to overwrite previous settings with the new template.
[in,out] error
Input a pointer to an error object. If an error occurs, this pointer is set to an actual error object containing the error information. You may specify nil for this parameter if you do not want the error information.
Code Snippet
Objective-C:
NSError __autoreleasing * _Nullable error;
[barcodeReader initRuntimeSettingsWithString:@"{\"Version\":\"3.0\", \"ImageParameter\":{\"Name\":\"IP1\", \"BarcodeFormatIds\":[\"BF_QR_CODE\"], \"ExpectedBarcodesCount\":10}}" conflictMode:EnumConflictModeOverwrite error:&error];
[barcodeReader appendTplStringToRuntimeSettings:@"{\"Version\":\"3.0\", \"ImageParameter\":{\"Name\":\"IP1\", \"BarcodeFormatIds\":[\"BF_OneD\"], \"ExpectedBarcodesCount\":20}}" conflictMode:EnumConflictModeIgnore error:&error];
Swift:
let error: NSError? = NSError()
barcodeReader.initRuntimeSettingsWithString(content:"{\"Version\":\"3.0\", \"ImageParameter\":{\"Name\":\"IP1\", \"BarcodeFormatIds\":[\"BF_QR_CODE\"], \"ExpectedBarcodesCount\":10}}", conflictMode:EnumConflictMode.Overwrite, error:&error)
barcodeReader.appendTplStringToRuntimeSettings(content:"{\"Version\":\"3.0\", \"ImageParameter\":{\"Name\":\"IP1\", \"BarcodeFormatIds\":[\"BF_OneD\"], \"ExpectedBarcodesCount\":20}}", conflictMode:EnumConflictMode.ignore, error:&error)
Get count of parameter templates.
- (NSArray<NSString*>* _Nullable)allParameterTemplateNames: (NSError *__autoreleasing _Nullable * _Nullable)error;
Parameters
[in,out] error
Input a pointer to an error object. If an error occurs, this pointer is set to an actual error object containing the error information. You may specify nil for this parameter if you do not want the error information.
Return Value
The template name array.
Code Snippet
Objective-C:
NSError __autoreleasing * _Nullable error;
[barcodeReader allParameterTemplateNames:&error];
Swift:
let error: NSError? = NSError()
barcodeReader.allParameterTemplateNames(error:&error)
Outputs runtime settings and save them into a settings file (JSON file).
- (void)outputSettingsToFile:(NSString *_Nullable)filePath
settingsName:(NSString*_Nonnull)settingsName
error:(NSError*_Nullable *_Nullable)error;
Parameters
[in] filePath
The path of the output file which stores current settings.
[in] settingsName
A unique name for declaring current runtime settings.
[in,out] error
Input a pointer to an error object. If an error occurs, this pointer is set to an actual error object containing the error information. You may specify nil for this parameter if you do not want the error information.
Code Snippet
Objective-C:
NSError __autoreleasing * _Nullable error;
settingsName = [barcodeReader outputSettingsToFile:@"your saving file path" settingsName:@"currentRuntimeSettings" error:&error];
Swift:
let error: NSError? = NSError()
let settingsName = barcodeReader.outputSettingsToFile(filePath:"your saving file path", settingsName:"currentRuntimeSettings", error:&error)
Output runtime settings to a string.
- (NSString *_Nullable)outputSettingsToString:(NSString*_Nonnull)settingsName
error:(NSError* _Nullable * _Nullable)error;
Parameters
[in] settingsName
A unique name for declaring current runtime settings.
[in,out] error
Input a pointer to an error object. If an error occurs, this pointer is set to an actual error object containing the error information. You may specify nil for this parameter if you do not want the error information.
Return Value
The output string which stores the content of current settings.
Code Snippet
Objective-C:
NSError __autoreleasing * _Nullable error;
settingsName = [barcodeReader outputSettingsToString:@"currentRuntimeSettings" error:&error];
Swift:
let error: NSError? = NSError()
let settingsName = barcodeReader.outputSettingsToString(settingsName:"currentRuntimeSettings", error:&error)
latest version