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");
        }
Пример #2
0
        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", Symbology.DataMatrix);

            // set various different properties/variables of the barcode.
            builder.BorderVisible = true;
            builder.ImageQuality  = ImageQualityMode.AntiAlias;
            builder.CodeLocation  = CodeLocation.Above;
            builder.Columns       = 4;
            builder.Rows          = 3;

            // Specify caption settings.
            builder.CaptionAbove           = new Caption("{Caption ABOVE}");
            builder.CaptionAbove.TextAlign = System.Drawing.StringAlignment.Center;
            builder.CaptionAbove.Visible   = true;
            builder.CaptionAbove.ForeColor = Color.Green;

            builder.CaptionBelow           = new Caption("{Caption BELOW}");
            builder.CaptionBelow.TextAlign = System.Drawing.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");

            Console.WriteLine(Environment.NewLine + "Barcode saved at " + dataDir + "BarCodeBuilder.DataMatrix.xml");
        }
        public static void Run()
        {
            // ExStart:ExportPropertiesToXML
            // 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");
            // ExEnd:ExportPropertiesToXML
        }