public void Save(string fileName)
Public Overloads Sub Save( _ByVal fileName As String _)
public:void Save(String^ fileName)
fileName
Name of the XML file to create
The load/save methods are provided as helper methods for the user. The BarcodeEngine, BarcodeWriter and BarcodeWriter do not use these methods internally.
To load the data previously saved into an XML file, use BarcodeWriteOptions.Load(string fileName).
To save and load data to an XML stream, use BarcodeWriteOptions.Save(Stream stream) and BarcodeWriteOptions.Load(Stream stream).
To save the default write options used by BarcodeWriter, use BarcodeWriter.SaveOptions
This example creates Linear 1D barcode write options class, saves it to disk and then loads it back.
using Leadtools;using Leadtools.Codecs;using Leadtools.Barcode;using Leadtools.ImageProcessing;public void BarcodeWriteOptions_LoadSaveExample(){string xmlFileName = Path.Combine(LEAD_VARS.ImagesDir, "MyOptions.xml");// Create the optionsOneDBarcodeWriteOptions options1 = new OneDBarcodeWriteOptions();// Show its valuesShowOptions("Default 1", options1);// Change some of the valuesoptions1.UseXModule = true;options1.EnableErrorCheck = true;options1.TextPosition = BarcodeOutputTextPosition.None;ShowOptions("New Options 1", options1);// Save it to diskoptions1.Save(xmlFileName);// Create new optionsOneDBarcodeWriteOptions options2 = new OneDBarcodeWriteOptions();// Show its valuesShowOptions("Default 2", options2);// Load the previously saved optionsoptions2.Load(xmlFileName);// Show its values, should be the same as "New Options 1"ShowOptions("Loaded 2", options2);}private static void ShowOptions(string message, OneDBarcodeWriteOptions options){// We will only show some of the options in this exampleConsole.WriteLine(message);Console.WriteLine(" UseXModule: {0}", options.UseXModule);Console.WriteLine(" EnableErrorCheck: {0}", options.EnableErrorCheck);Console.WriteLine(" TextPosition: {0}", options.TextPosition);Console.WriteLine("----------------");}static class LEAD_VARS{public const string ImagesDir = @"C:\Users\Public\Documents\LEADTOOLS Images";}
Imports LeadtoolsImports Leadtools.CodecsImports Leadtools.BarcodeImports Leadtools.ImageProcessingPublic Sub BarcodeWriteOptions_LoadSaveExample()Dim xmlFileName As String = Path.Combine(LEAD_VARS.ImagesDir, "MyOptions.xml")' Create the optionsDim options1 As New OneDBarcodeWriteOptions()' Show its valuesShowOptions("Default 1", options1)' Change some of the valuesoptions1.UseXModule = Trueoptions1.EnableErrorCheck = Trueoptions1.TextPosition = BarcodeOutputTextPosition.NoneShowOptions("New Options 1", options1)' Save it to diskoptions1.Save(xmlFileName)' Create new optionsDim options2 As New OneDBarcodeWriteOptions()' Show its valuesShowOptions("Default 2", options2)' Load the previously saved optionsoptions2.Load(xmlFileName)' Show its values, should be the same as "New Options 1"ShowOptions("Loaded 2", options2)End SubPrivate Shared Sub ShowOptions(ByVal message As String, ByVal options As OneDBarcodeWriteOptions)' We will only show some of the options in this exampleConsole.WriteLine(message)Console.WriteLine(" UseXModule: {0}", options.UseXModule)Console.WriteLine(" EnableErrorCheck: {0}", options.EnableErrorCheck)Console.WriteLine(" TextPosition: {0}", options.TextPosition)Console.WriteLine("----------------")End SubPublic NotInheritable Class LEAD_VARSPublic Const ImagesDir As String = "C:\Users\Public\Documents\LEADTOOLS Images"End Class
Help Collections
Raster .NET | C API | C++ Class Library | HTML5 JavaScript
Document .NET | C API | C++ Class Library | HTML5 JavaScript
Medical .NET | C API | C++ Class Library | HTML5 JavaScript
Medical Web Viewer .NET
Multimedia
Direct Show .NET | C API | Filters
Media Foundation .NET | C API | Transforms
Supported Platforms
.NET, Java, Android, and iOS/macOS Assemblies
Imaging, Medical, and Document
C API/C++ Class Libraries
Imaging, Medical, and Document
HTML5 JavaScript Libraries
Imaging, Medical, and Document
