Aspose.BarCode.Examples.CSharp.ManageBarCodes.ExportPropertiesToXML.Run C# (CSharp) Method

Run() public static method

public static Run ( ) : void
return void
        public static void Run()
        {
            // The path to the documents directory.
            string dataDir = RunExamples.GetDataDir_ManageBarCodes();

            // Initialize the BarCodeBuilder class by passing barcode text and barcode symbology as parameters.
            BarCodeBuilder builder = new BarCodeBuilder("abcdefghijklmnopqrstuvwxyzabcdef", EncodeTypes.DataMatrix)
            {
                // Set various different properties/variables of the barcode.
                BorderVisible = true,
                ImageQuality = ImageQualityMode.AntiAlias,
                CodeLocation = CodeLocation.Above,
                Columns = 4,
                Rows = 3,
                CaptionAbove = new Caption("{Caption ABOVE}")
                {
                    TextAlign = StringAlignment.Center,
                    Visible = true,
                    ForeColor = Color.Green
                }
            };
           
            // Specify caption settings.
            builder.CaptionBelow = new Caption("{Caption BELOW}");
            builder.CaptionBelow.TextAlign = StringAlignment.Far;
            builder.CaptionBelow.Visible = true;
            builder.CaptionBelow.ForeColor = Color.Yellow;

            // Specify text font settings.
            builder.CodeTextFont = new Font("Courier New", 24, FontStyle.Bold | FontStyle.Italic);

            // Call the export to XML method to export the properties to XML file.
            builder.ExportToXml(dataDir + "BarCodeBuilder.DataMatrix_out.xml");
        }
    }
ExportPropertiesToXML