public static void Run() { // The path to the documents directory. string dataDir = RunExamples.GetDataDir_ManageBarCodesImages(); // Instantiate barcode object set codeText and location BarCodeBuilder barCodeBuilder = new BarCodeBuilder {CodeText = "1234567", CodeLocation = CodeLocation.Above}; barCodeBuilder.Save(dataDir + "barcode-SetCodetextLocation_out.jpeg", ImageFormat.Jpeg); }
public static void Run() { // The path to the documents directory. string dataDir = RunExamples.GetDataDir_CreateAndManage2DBarCodes(); try { MemoryStream memoryStream = new MemoryStream(); // Instantiate barcode object, Set CodeText, Barcode Symbology and Text Encoding using (BarCodeBuilder barCodeBuilder = new BarCodeBuilder()) { BarCodeBuilder builder = new BarCodeBuilder("Слово", EncodeTypes.QR); barCodeBuilder.CodeTextEncoding = Encoding.UTF8; barCodeBuilder.Save(dataDir + "" + memoryStream + "_out.png", BarCodeImageFormat.Png); } string fileName = dataDir + "" + memoryStream + "_out.png"; using (BarCodeReader reader = new BarCodeReader(fileName, DecodeType.QR)) { reader.SetDetectEncoding(false); if (reader.Read()) Console.WriteLine(reader.GetCodeText(Encoding.UTF8)); //"Слово" } } catch (Exception) {} }
public static void Run() { // The path to the documents directory. string dataDir = RunExamples.GetDataDir_ManageBarCodes(); // Instantiate linear barcode object BarCodeBuilder barCodeBuilder = new BarCodeBuilder("1234567",EncodeTypes.Code39Standard); // Set the wide to narrow ratio for the barcode barCodeBuilder.WideNarrowRatio = 3.0f; // Save the image to your system and set its image format to Jpeg barCodeBuilder.Save(dataDir + "barcode_ratio_3_out.jpg", ImageFormat.Jpeg); // Set the wide to narrow ratio for the barcode barCodeBuilder.WideNarrowRatio = 5.0f; // Save the image to your system and set its image format to Jpeg barCodeBuilder.Save(dataDir + "barcode_ratio_5_out.jpg", ImageFormat.Jpeg); // Set the wide to narrow ratio for the barcode barCodeBuilder.WideNarrowRatio = 7.0f; // Save the image to your system and set its image format to Jpeg barCodeBuilder.Save(dataDir + "barcode_ratio_7_out.jpg", ImageFormat.Jpeg); // Set the wide to narrow ratio for the barcode barCodeBuilder.WideNarrowRatio = 9.0f; // Save the image to your system and set its image format to Jpeg barCodeBuilder.Save(dataDir + "code39-wide-narrow-ratio_out.jpg", ImageFormat.Jpeg); }
public static void Run() { // The path to the documents directory. string dataDir = RunExamples.GetDataDir_BarCodeImage(); string dst = dataDir + "barcode-size-unit.jpg"; //Instantiate barcode object BarCodeBuilder bb = new BarCodeBuilder(); //Set the Code text for the barcode bb.CodeText = "1234567"; //Set the symbology type to Code128 bb.SymbologyType = Symbology.Code128; //Set the bar height to 3 points bb.BarHeight = 3.0f; //Set the measuring unit of barcode to point bb.GraphicsUnit = System.Drawing.GraphicsUnit.Point; //Save the image to your system //and set its image format to Jpeg bb.Save(dst, System.Drawing.Imaging.ImageFormat.Jpeg); Console.WriteLine(Environment.NewLine + "Barcode saved at " + dst); }
public static void Run() { try { // ExStart:CreateAndSetSizeForImageWithBarcode // The path to the documents directory. string dataDir = RunExamples.GetDataDir_ManageBarCodes(); // Generate the barcode and set code text, symbology type BarCodeBuilder builder = new BarCodeBuilder("One thing 2 thing", EncodeTypes.Pdf417); // Set the code text location, graphics unit and margins builder.CodeLocation = CodeLocation.None; builder.GraphicsUnit = GraphicsUnit.Pixel; builder.Margins.Set(0); // Get Bitmap with exact barcode only Bitmap bmp = builder.GetOnlyBarCodeImage(); // Allows to set size for whole picture with barcode inside and Save image on local disk Bitmap bitmap = builder.GetCustomSizeBarCodeImage(new Size(bmp.Width * 5, bmp.Height * 5), false); bitmap.Save(dataDir + "CreateAndSetSizeForImageWithBarcode_out.Png"); // ExEnd:CreateAndSetSizeForImageWithBarcode } catch (Exception ex) { Console.WriteLine(ex.Message + "\nThis example will only work if you apply a valid Aspose License. You can purchase full license or get 30 day temporary license from http://www.aspose.com/purchase/default.aspx."); } }
public static void Run() { // The path to the documents directory. string dataDir = RunExamples.GetDataDir_BarCodeImage(); string dst = dataDir + "barcode-image-resolution.jpg"; //Instantiate barcode object BarCodeBuilder bb = new BarCodeBuilder(); //Set the Code text for the barcode bb.CodeText = "1234567"; //Set the symbology type to Code128 bb.SymbologyType = Symbology.Code128; //Create an instance of resolution and apply on the barcode image with //customized resolution settings bb.Resolution = new Resolution(200f, 400f, ResolutionMode.Customized); //Save the image to your system //and set its image format to Jpeg bb.Save(dst, System.Drawing.Imaging.ImageFormat.Jpeg); Console.WriteLine(Environment.NewLine + "Barcode saved at " + dst); }
protected void Page_Load(object sender, EventArgs e) { string CodeText = Request.QueryString["codetext"]; string Symbology = Request.QueryString["symbology"]; if (String.IsNullOrEmpty(CodeText)) CodeText = "Aspose .NET BarCode Generator for Dynamics CRM"; //Instantiate barcode object BarCodeBuilder BarCode = new BarCodeBuilder(); //Set the Code text for the barcode BarCode.CodeText = CodeText; //Set the symbology type to Code128 string SymbologyText = Symbology; BarCode.SymbologyType = GetSymbologyType(SymbologyText); //Create an instance of resolution and apply on the barcode image with //customized resolution settings BarCode.Resolution = new Resolution(200f, 400f, ResolutionMode.Customized); MemoryStream MemoryStream = new MemoryStream(); BarCode.Save(MemoryStream, BarCodeImageFormat.Png); byte[] byteData = MemoryStream.ToArray(); Response.Clear(); Response.ContentType = "image/jpeg"; Response.BinaryWrite(byteData); Response.End(); }
public static void Run() { // The path to the documents directory. string dataDir = RunExamples.GetDataDir_ManageBarCodesImages(); // Instantiate barcode object BarCodeBuilder barCodeBuilder = new BarCodeBuilder { CaptionAbove = { TextAlign = StringAlignment.Near, Text = "Aspose.Demo", Visible = true, Font = new Font("Pristina", 14f), ForeColor = Color.OrangeRed } }; barCodeBuilder.CaptionBelow.TextAlign = StringAlignment.Far; barCodeBuilder.CaptionBelow.Text = "Aspose.Demo"; barCodeBuilder.CaptionBelow.Visible = true; barCodeBuilder.CaptionBelow.Font = new Font("Pristina", 14f); barCodeBuilder.CaptionBelow.ForeColor = Color.OrangeRed; // Save the image to your system and set its image format to Jpeg barCodeBuilder.Save(dataDir + "SetFontandColorSetting_out.jpeg", ImageFormat.Jpeg); }
public static void Run() { // The path to the documents directory. string dataDir = RunExamples.GetDataDir_BarCodeImage(); string dst = dataDir + "barcode-image-borders.jpg"; //Instantiate barcode object BarCodeBuilder bb = new BarCodeBuilder(); //Set border style to solid bb.BorderDashStyle = Aspose.BarCode.BorderDashStyle.Solid; //Set border margins by assigning an instance of MarginsF bb.Margins = new Aspose.BarCode.MarginsF(2f, 2f, 2f, 2f); //Set border width bb.BorderWidth = 0.5f; //Enable border to be shown in the barcode bb.BorderVisible = true; //Save the image to your system //and set its image format to Jpeg bb.Save(dst, System.Drawing.Imaging.ImageFormat.Jpeg); Console.WriteLine(Environment.NewLine + "Barcode saved at " + dst); }
public static void Run() { // The path to the documents directory. string dataDir = RunExamples.GetDataDir_BarCodeImage(); string dst = dataDir + "barcode-image-margins.jpg"; //Instantiate barcode object BarCodeBuilder bb = new BarCodeBuilder(); //Set the Code text for the barcode bb.CodeText = "1234567"; //Set the symbology type to Code128 bb.SymbologyType = Symbology.Code128; // sets the left margin bb.Margins.Left = 0.5f; // sets the right margin bb.Margins.Right = 0f; // sets the top margin bb.Margins.Top = 0f; // sets the bottom margin bb.Margins.Bottom = 0f; //Save the image to your system //and set its image format to Jpeg bb.Save(dst, System.Drawing.Imaging.ImageFormat.Jpeg); Console.WriteLine(Environment.NewLine + "Barcode saved at " + dst); }
public static void Run() { // The path to the documents directory. string dataDir = RunExamples.GetDataDir_ProgrammingBarCode(); string dst = dataDir + "codetext-appearence.jpg"; //Instantiate bar code object BarCodeBuilder bc = new BarCodeBuilder(); //Set the Code text for the bar code bc.CodeText = "1234567"; //Align the code text to center bc.CodeTextAlignment = System.Drawing.StringAlignment.Center; //Set the location of the code text to above the bar code bc.CodeLocation = CodeLocation.Above; //Set the code text fore color to red bc.CodeTextColor = System.Drawing.Color.Red; //Increase the space between code text and barcode to 1 point bc.CodeTextSpace = 1.0f; //Set the symbology type to Code128 bc.SymbologyType = Symbology.Code128; //Save the image to your system and set its image format to Jpeg bc.Save(dst, System.Drawing.Imaging.ImageFormat.Jpeg); Console.WriteLine(Environment.NewLine + "Barcode saved at " + dst); }
public static void Run() { // The path to the documents directory. string dataDir = RunExamples.GetDataDir_ManageBarCodes(); string dstCode128 = dataDir + "code128-YDimensionChanged_out.jpg"; // Instantiate barcode object and set CodeText & Barcode Symbology BarCodeBuilder barCodeBuilder = new BarCodeBuilder("1234567", EncodeTypes.Code128); // Save the image to your system and set its image format to Jpeg barCodeBuilder.Save(dstCode128, ImageFormat.Jpeg); // Set the X-Dimension for the bars of the barcode barCodeBuilder.xDimension = 0.5f; // Set the measuring unit of barcode to millimeter barCodeBuilder.GraphicsUnit = GraphicsUnit.Millimeter; // Save the image to your system and set its image format to Jpeg barCodeBuilder.Save(dstCode128, ImageFormat.Jpeg); // Instantiate barcode object and set differnt barcode properties BarCodeBuilder barCodeBuilder1 = new BarCodeBuilder("1234567", EncodeTypes.Pdf417) { yDimension = 4 }; // Save the image to your system and set its image format to Jpeg barCodeBuilder1.Save(dataDir + "pdf417-YDimensionChanged_out.jpg", ImageFormat.Jpeg); }
public static void Run() { // The path to the documents directory. string dataDir = RunExamples.GetDataDir_BarCodeImage(); string dst = dataDir + "colorize-barcode.jpg"; //Instantiate barcode object BarCodeBuilder bb = new BarCodeBuilder(); //Set the Code text for the barcode bb.CodeText = "1234567"; //Set the symbology type to Code128 bb.SymbologyType = Symbology.Code128; //Set background color of the barcode bb.BackColor = System.Drawing.Color.Yellow; //Set color (fore color) of the barcode bb.ForeColor = System.Drawing.Color.Blue; //Set border color of the barcode bb.BorderColor = System.Drawing.Color.Red; //Set color of the code text of the barcode bb.CodeTextColor = System.Drawing.Color.Red; //Save the image to your system //and set its image format to Jpeg bb.Save(dst, System.Drawing.Imaging.ImageFormat.Jpeg); Console.WriteLine(Environment.NewLine + "Barcode saved at " + dst); }
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"); }
public static void Run() { // The path to the documents directory. string dataDir = RunExamples.GetDataDir_CreateAndManage2DBarCodes(); // Instantiate barcode object and set CodeText & Barcode Symbology BarCodeBuilder barCodeBuilder = new BarCodeBuilder("123456789", EncodeTypes.Aztec); barCodeBuilder.Save(dataDir + "CreateAztecbarcode_out.bmp", BarCodeImageFormat.Bmp); }
public static void Run() { // The path to the documents directory. string dataDir = RunExamples.GetDataDir_ManageBarCodes(); // Instantiate BarCodeBuilder object Set the Code text & SymbologyType for the barcode BarCodeBuilder barCodeBuilder = new BarCodeBuilder("1234567890", EncodeTypes.Pdf417); barCodeBuilder.Save(dataDir + "pdf417-barcode_out.jpg", BarCodeImageFormat.Jpeg); }
public static void Run() { // The path to the documents directory. string dataDir = RunExamples.GetDataDir_ManageBarCodes(); // Instantiate barcode object and set CodeText & Barcode Symbology BarCodeBuilder barCodeBuilder = new BarCodeBuilder("1234567890",EncodeTypes.DataMatrix); barCodeBuilder.Save(dataDir + "datamatrix-barcode_out.jpg", BarCodeImageFormat.Jpeg); }
public static void Run() { // The path to the documents directory. string dataDir = RunExamples.GetDataDir_ManageBarCodesImages(); // Instantiate barcode object and Set Code text font's type and size BarCodeBuilder barCodeBuilder = new BarCodeBuilder { CodeTextFont = new Font("Verdana", 12f) }; barCodeBuilder.Save(dataDir + "SetCodeTextFontFamilyNameAndSize_out.bmp", ImageFormat.Bmp); }
public static void Run() { // The path to the documents directory. string dataDir = RunExamples.GetDataDir_ManageBarCodes(); // Instantiate barcode object BarCodeBuilder bb = new BarCodeBuilder("1234567", EncodeTypes.Code128); bb.Save(dataDir + "barcode-SpecifySymbologies_out.jpg", ImageFormat.Jpeg); }
public static void Run() { // The path to the documents directory. string dataDir = RunExamples.GetDataDir_ManageBarCodesImages(); // Instantiate barcode object and set CodeText & Barcode Symbology BarCodeBuilder barCodeBuilder = new BarCodeBuilder("1234567", EncodeTypes.Code128); barCodeBuilder.Save(dataDir + "barcode-image-format_out.jpeg", ImageFormat.Jpeg); }
public static void Run() { // The path to the documents directory. string dataDir = RunExamples.GetDataDir_ManageBarCodes(); // Instantiate barcode object and set CodeText & Barcode Symbology BarCodeBuilder barCodeBuilder = new BarCodeBuilder("1234", EncodeTypes.Code128); barCodeBuilder.Save(dataDir + "Code128-customized_out.png"); }
public static void Run() { // The path to the documents directory. string dataDir = RunExamples.GetDataDir_ManageBarCodes(); // Create instance of BarCodeBuilder, specify codetext symbology and encode mode BarCodeBuilder builder = new BarCodeBuilder("test123", EncodeTypes.QR) {QREncodeMode = QREncodeMode.Auto}; builder.Save(dataDir + "QR-Encode-mode_out.jpg"); }
public static void Run() { // The path to the documents directory. string dataDir = RunExamples.GetDataDir_ManageBarCodesImages(); // Instantiate barcode object and set Increase the space between code text and barcode to 1 point BarCodeBuilder barCodeBuilder = new BarCodeBuilder {CodeTextSpace = 1.0f}; barCodeBuilder.Save(dataDir + "AddSpaceInBarCodeAndText_out.bmp", ImageFormat.Bmp); }
public static void Run() { // The path to the documents directory. string dataDir = RunExamples.GetDataDir_CreateAndManage2DBarCodes(); // Create instance of BarCodeBuilder class, Set Aspect Ratio to 3:2 or 1.5 and Save the barcode image to disk in PNG format BarCodeBuilder barCodeBuilder = new BarCodeBuilder("1234567890", EncodeTypes.Pdf417); barCodeBuilder.AspectRatio = 1.5f; barCodeBuilder.Save(dataDir + "SetAspectRatio_out.png", BarCodeImageFormat.Png); }
public static void Run() { // The path to the documents directory. string dataDir = RunExamples.GetDataDir_ManageBarCodes(); // Instantiate barcode object and set differnt barcode properties BarCodeBuilder barCodeBuilder = new BarCodeBuilder("1234567", EncodeTypes.Code128); // Save the image to your system and set its image format to Jpeg barCodeBuilder.Save(dataDir + "barcode-symbiology_out.jpg", ImageFormat.Jpeg); }
public static void Run() { // ExStart:SwissPostParcelBarcodeWithInternationalMailType // The path to the documents directory. string dataDir = RunExamples.GetDataDir_ManageBarCodes(); // Generate the barcode and Save barcode on local BarCodeBuilder builder = new BarCodeBuilder("RA121212122CH", EncodeTypes.SwissPostParcel); builder.Save(dataDir + "SwissPostParcelBarcodeWithInternationalMailType_out.png"); // ExEnd:SwissPostParcelBarcodeWithInternationalMailType }
public static void Run() { // The path to the documents directory. string dataDir = RunExamples.GetDataDir_CreateAndManage2DBarCodes(); string codeText = "The quick brown fox jumps over the lazy dog\n" + "The quick brown fox jumps over the lazy dog\n"; // Instantiate barcode object, Set CodeText, Symbology and CodeLocation BarCodeBuilder barCodeBuilder = new BarCodeBuilder(codeText, EncodeTypes.DataMatrix); barCodeBuilder.CodeLocation = CodeLocation.None; barCodeBuilder.Save(dataDir + "HideBarcodeCodeText_out.png", BarCodeImageFormat.Png); }
public static void Run() { // ExStart:CreateCouponExtendedBarcode // The path to the documents directory. string dataDir = RunExamples.GetDataDir_ManageBarCodes(); // Instantiate barcode object and set CodeText & Barcode Symbology BarCodeBuilder barCodeBuilder = new BarCodeBuilder("514141100906(8102)03", EncodeTypes.UpcaGs1Code128Coupon); barCodeBuilder.Save(dataDir + "UpcaGs1Code128Coupon_out.png"); // ExEnd:CreateCouponExtendedBarcode }
public static void Run() { // ExStart:SwissPostParcelSymbology // The path to the documents directory. string dataDir = RunExamples.GetDataDir_ManageBarCodes(); // Generate the barcode and Save barcode on local BarCodeBuilder builder = new BarCodeBuilder("0610", EncodeTypes.SwissPostParcel); builder.Save(dataDir + "SwissPostParcelSymbology_out.png"); // ExEnd:SwissPostParcelSymbology }
public static void Run() { // The path to the documents directory. string dataDir = RunExamples.GetDataDir_ManageBarCodes(); // Create instance of BarCodeBuilder, specify codetext and symbology in the constructor BarCodeBuilder builder = new BarCodeBuilder("1234567890", EncodeTypes.QR); // Set QRErrorLevel and Save the file to disk. builder.QRErrorLevel = QRErrorLevel.LevelH; builder.Save(dataDir + "QR-error-correction_out.jpg", BarCodeImageFormat.Jpeg); }
private void button1_Click(object sender, EventArgs e) { BarCodeBuilder bb = new BarCodeBuilder(); //Set the Code text for the barcode bb.CodeText = textBox2.Text; pictureBox1.Image = bb.BarCodeImage; bb.Save("CodeBar\\" + textBox2.Text + ".bmp", bb.BarCodeImage.RawFormat); Global.Margem.CodeBarURL = "CodeBar\\" + textBox2.Text + ".bmp"; Global.Margem.CodeBarTexto = textBox1.Text; DALCadastro.InsereImpressao("ImprimeCodeBar"); //System.Diagnostics.Process.Start(Global.Margem.CodeBarURL); MessageBox.Show("Código de barras enviado para a impressora"); this.Close(); }
public static void Run() { // The path to the documents directory. string dataDir = RunExamples.GetDataDir_ManageBarCodes(); // Create instance of BarCodeBuilder, specify codetext and symbology in the constructor BarCodeBuilder builder = new BarCodeBuilder("11112222333344", Symbology.Codabar); // Set the codabar start symbol to A builder.CodabarStartSymbol = CodabarSymbol.A; // Set the codabar stop symbol to D builder.CodabarStopSymbol = CodabarSymbol.D; // Save the image to disk in PNG format builder.Save(dataDir + "Coabar-start-stop-symbols_out.png"); }
public static void Run() { // The path to the documents directory. string dataDir = RunExamples.GetDataDir_ProgrammingBarCode(); string dst = dataDir + "QR-Encode-mode.jpg"; // Create instance of BarCodeBuilder, specify codetext and symbology in the constructor BarCodeBuilder builder = new BarCodeBuilder("test123", Symbology.QR); // Set QR encode mode builder.QREncodeMode = Aspose.BarCode.QREncodeMode.Auto; // Save the image to disk in PNG format builder.Save(dst); Console.WriteLine(Environment.NewLine + "Barcode saved at " + dst); }
public static void Run() { // ExStart:GeneratingGS1ForCodablock // The path to the documents directory. string dataDir = RunExamples.GetDataDir_ManageBarCodes(); // Create instance of BarCodeBuilder class. BarCodeBuilder b = new BarCodeBuilder(); // Specify code text and set encode type. b.CodeText = "(01)03412345678900(17)010200"; b.EncodeType = EncodeTypes.GS1CodablockF; // Save the image to disk in PNG format b.BarCodeImage.Save("GS1CodablockF_out.png"); // ExEnd:GeneratingGS1ForCodablock }
public static void Run() { // ExStart:CreatePdf417BarcodeWithTurkishCharacters // The path to the documents directory. string dataDir = RunExamples.GetDataDir_ManageBarCodes(); const string codetext = "AYŞE" + "\n" + "Ümit" + "\n" + "Ü[email protected]" + "\n" + "Türkiye"; // Generate the barcode BarCodeBuilder builder = new BarCodeBuilder(codetext, EncodeTypes.Pdf417); // Encode the code text and Set the display text byte[] bytes = Encoding.GetEncoding(1254).GetBytes(codetext); builder.SetBinaryCodeText(bytes); builder.Display2DText = codetext; builder.Save(dataDir + "CreatePdf417BarcodeWithTurkishCharacters_out.png"); // ExEnd:CreatePdf417BarcodeWithTurkishCharacters }
public static void Run() { // The path to the documents directory. string dataDir = RunExamples.GetDataDir_ManageBarCodes(); // Instantiate barcode object BarCodeBuilder bb = new BarCodeBuilder(); // Set the Code text for the barcode bb.CodeText = "1234567"; // Set the symbology type to Code128 bb.SymbologyType = Symbology.Code128; // Save the image to your system and set its image format to Jpeg bb.Save(dataDir + "barcode-SpecifySymbologies_out.jpg", System.Drawing.Imaging.ImageFormat.Jpeg); }
public static void Run() { // The path to the documents directory. string dataDir = RunExamples.GetDataDir_ManageBarCodes(); // Instantiate BarCodeBuilder object BarCodeBuilder barCodeBuilder = new BarCodeBuilder(); // Set the SymbologyType for the barcode barCodeBuilder.SymbologyType = Symbology.Pdf417; // Set the Code text for the barcode barCodeBuilder.CodeText = "1234567890"; // Save file to disk barCodeBuilder.Save(dataDir + "pdf417-barcode_out.jpg", BarCodeImageFormat.Jpeg); }
public static void Run() { // ExStart:BarcodeImageResolution // The path to the documents directory. string dataDir = RunExamples.GetDataDir_ManageBarCodesImages(); // Instantiate barcode object and set CodeText & Barcode Symbology BarCodeBuilder barCodeBuilder = new BarCodeBuilder("1234567", EncodeTypes.Code128) { // Create an instance of resolution and apply on the barcode image with customized resolution settings Resolution = new Resolution(200f, 400f, ResolutionMode.Customized) }; // Save the image to your system and set its image format to Jpeg barCodeBuilder.Save(dataDir + "barcode-image-resolution_out.jpeg", ImageFormat.Jpeg); // ExEnd:BarcodeImageResolution }
public static void Run() { // ExStart:SetCodeText // The path to the documents directory. string dataDir = RunExamples.GetDataDir_ManageBarCodes(); // Instantiate barcode object and set differnt barcode properties BarCodeBuilder barCodeBuilder = new BarCodeBuilder("1234567", EncodeTypes.Code128) { xDimension = 1f }; // Save the image to your system and set its image format to Jpeg barCodeBuilder.Save(dataDir + "barcode-codetext_out.jpg", ImageFormat.Jpeg); Console.WriteLine(Environment.NewLine + "Barcode saved at " + dataDir + "barcode-codetext_out.jpg"); // ExEnd:SetCodeText }
public static void Run() { //ExStart:ManagePDF417Barcode // The path to the documents directory. string dataDir = RunExamples.GetDataDir_CreateAndManage2DBarCodes(); // Instantiate barcode object BarCodeBuilder barCodeBuilder = new BarCodeBuilder("1234567890", EncodeTypes.Pdf417); // Set Pdf417 Error correction level, Compaction Mode to Text and CodeText for barcode barCodeBuilder.Pdf417ErrorLevel = Pdf417ErrorLevel.Level8; barCodeBuilder.Pdf417CompactionMode = Pdf417CompactionMode.Text; barCodeBuilder.CodeText = "1234567890"; barCodeBuilder.Save(dataDir + "ManagePDF417Barcode_out.bmp", ImageFormat.Bmp); Console.WriteLine(Environment.NewLine + "Barcode saved at " + dataDir + "Datamatrixbarcode_out.bmp"); //ExEnd:ManagePDF417Barcode }
public static void Run() { // The path to the documents directory. string dataDir = RunExamples.GetDataDir_ManageBarCodes(); // Initialize BarCodeBuilder BarCodeBuilder barCodeBuilder = new BarCodeBuilder(); // Set the Smbology Type barCodeBuilder.SymbologyType = Symbology.QR; // Set the Code text for the barcode barCodeBuilder.CodeText = "1234567890"; // Save the file on disk and set its image format to Jpeg barCodeBuilder.Save(dataDir + "CreateQRbarcode_out.bmp", BarCodeImageFormat.Bmp); }
public static void Run() { // The path to the documents directory. string dataDir = RunExamples.GetDataDir_ManageBarCodesImages(); string dst = dataDir + "barcode-SetCodeAlignment_out.jpg"; // Instantiate barcode object BarCodeBuilder barCodeBuilder = new BarCodeBuilder(); // Set the Code text for the barcode barCodeBuilder.CodeText = "1234567"; // lign the code text to center barCodeBuilder.CodeTextAlignment = System.Drawing.StringAlignment.Center; Console.WriteLine(Environment.NewLine + "Barcode saved at " + dst); }
public static void Run() { // ExStart:SetSizeUnitForBarcodeImage // The path to the documents directory. string dataDir = RunExamples.GetDataDir_ManageBarCodesImages(); // Instantiate barcode object BarCodeBuilder barCodeBuilder = new BarCodeBuilder("1234567", EncodeTypes.Code128) { // Set the bar height to 3 points and measuring unit of barcode to point BarHeight = 3.0f, GraphicsUnit = GraphicsUnit.Point }; barCodeBuilder.Save(dataDir + "barcode-size-unit_out.jpeg", ImageFormat.Jpeg); // ExEnd:SetSizeUnitForBarcodeImage }
public static void Run() { // ExStart:SetSupplementData // The path to the documents directory. string dataDir = RunExamples.GetDataDir_ManageBarCodes(); // Instantiate barcode object BarCodeBuilder barCodeBuilder = new BarCodeBuilder("123456789123", EncodeTypes.EAN13) { // Set the supplement data (5 Digit) SupplementData = "12345", SupplementSpace = 2.0f }; barCodeBuilder.Save(dataDir + "SetSupplementData_out.jpg", ImageFormat.Jpeg); // ExEnd:SetSupplementData }
public static void Run() { // The path to the documents directory. string dataDir = RunExamples.GetDataDir_ManageBarCodesImages(); // Instantiate barcode object BarCodeBuilder barCodeBuilder = new BarCodeBuilder(); // Set the Code text for the barcode barCodeBuilder.CodeText = "1234567"; // Set the location of the code text to above the barcode barCodeBuilder.CodeLocation = CodeLocation.Above; // Save the image to your system in Jpeg format barCodeBuilder.Save(dataDir + "barcode-SetCodetextLocation_out.jpeg", System.Drawing.Imaging.ImageFormat.Jpeg); }
public static void Run() { // ExStart:GeneratingGS1_128AI8012Barcode // The path to the documents directory. string dataDir = RunExamples.GetDataDir_ManageBarCodes(); // Create instance of BarCodeBuilder class. BarCodeBuilder b = new BarCodeBuilder(); // Specify code text and set encode type. b.CodeText = "(8012)ABC123"; b.EncodeType = EncodeTypes.GS1Code128; // Save the image to disk in PNG format b.BarCodeImage.Save("AI8012_out.png"); // ExEnd:GeneratingGS1_128AI8012Barcode }
public static void Run() { // ExStart:CodabarStartStopSymbols // The path to the documents directory. string dataDir = RunExamples.GetDataDir_ManageBarCodes(); // Create instance of BarCodeBuilder, specify codetext and symbology in the constructor BarCodeBuilder builder = new BarCodeBuilder("11112222333344", EncodeTypes.Codabar) { // Set the codabar start symbol to A and stop symbol to D CodabarStartSymbol = CodabarSymbol.A, CodabarStopSymbol = CodabarSymbol.D }; builder.Save(dataDir + "Coabar-start-stop-symbols_out.png"); // ExEnd:CodabarStartStopSymbols }
public static void Run() { // The path to the documents directory. string dataDir = RunExamples.GetDataDir_ManageBarCodes(); // Instantiate barcode object BarCodeBuilder builder = new BarCodeBuilder("(01)90013670000396(3200)15(11)150819"); // Set the SymbologyType and Height and Resolution for barcode builder.SymbologyType = Symbology.DatabarStackedOmniDirectional; builder.xDimension = 0.330f; builder.BarHeight = 27.77f; builder.Resolution = new Resolution(1200.0f, 1200.0f, ResolutionMode.Customized); // Save the image to your system and set its image format to Jpeg builder.Save(dataDir + "Barheight_out.png", BarCodeImageFormat.Png); }
public static void Run() { // The path to the documents directory. string dataDir = RunExamples.GetDataDir_ProgrammingBarCode(); string dst = dataDir + "code39-wide-narrow-ratio.png"; //Instantiate linear barcode object BarCodeBuilder bb = new BarCodeBuilder(); //Set the Code text for the barcode bb.CodeText = "1234567"; //Set the symbology type to Code39 bb.SymbologyType = Symbology.Code39Standard; //Set the wide to narrow ratio for the barcode bb.WideNarrowRatio = 3.0f; //Save the image to your system //and set its image format to Jpeg bb.Save(dataDir + "barcode_ratio_3.jpg", System.Drawing.Imaging.ImageFormat.Jpeg); //Set the wide to narrow ratio for the barcode bb.WideNarrowRatio = 5.0f; //Save the image to your system //and set its image format to Jpeg bb.Save(dataDir + "barcode_ratio_5.jpg", System.Drawing.Imaging.ImageFormat.Jpeg); //Set the wide to narrow ratio for the barcode bb.WideNarrowRatio = 7.0f; //Save the image to your system //and set its image format to Jpeg bb.Save(dataDir + "barcode_ratio_7.jpg", System.Drawing.Imaging.ImageFormat.Jpeg); //Set the wide to narrow ratio for the barcode bb.WideNarrowRatio = 9.0f; //Save the image to your system //and set its image format to Jpeg bb.Save(dst, System.Drawing.Imaging.ImageFormat.Jpeg); Console.WriteLine(Environment.NewLine + "Barcode saved at " + dst); }
public static void Run() { // The path to the documents directory. string dataDir = RunExamples.GetDataDir_ProgrammingBarCode(); string dst = dataDir + "barcode-caption.jpg"; //Instantiate barcode object BarCodeBuilder bb = new BarCodeBuilder(); //Set the Code text for the barcode bb.CodeText = "1234567"; //Set the symbology type to Code128 bb.SymbologyType = Symbology.Code128; bb.CaptionAbove.Visible = false; //Create caption object. Set its text and text alignment & also make it visible Caption caption = new Caption(); caption.Text = "Aspose"; caption.TextAlign = System.Drawing.StringAlignment.Center; caption.Visible = true; caption.Font = new System.Drawing.Font("Pristina", 14f); caption.ForeColor = System.Drawing.Color.Red; //Assign caption object to be displayed above the barcode bb.CaptionAbove = caption; Caption captionBelow = new Caption(); captionBelow.Text = "Aspose.BarCode Caption Below"; captionBelow.TextAlign = System.Drawing.StringAlignment.Center; captionBelow.Visible = true; captionBelow.Font = new System.Drawing.Font("Pristina", 14f); captionBelow.ForeColor = System.Drawing.Color.OrangeRed; //Assign caption object to be displayed below the barcode bb.CaptionBelow = captionBelow; //Save the image to your system and set its image format to Jpeg bb.Save(dst, System.Drawing.Imaging.ImageFormat.Jpeg); Console.WriteLine(Environment.NewLine + "Barcode saved at " + dst); }
public static void Run() { // ExStart:BarcodeImageBorders // The path to the documents directory. string dataDir = RunExamples.GetDataDir_ManageBarCodesImages(); // Instantiate barcode object and set different properties BarCodeBuilder barCodeBuilder = new BarCodeBuilder { BorderDashStyle = BorderDashStyle.Solid, Margins = new MarginsF(2f, 2f, 2f, 2f), BorderWidth = 0.5f, BorderVisible = true }; barCodeBuilder.Save(dataDir + "barcodeImageborders_out.jpeg", ImageFormat.Jpeg); // ExEnd:BarcodeImageBorders }
public static void Run() { // ExStart:BarcodeCustomSize // The path to the documents directory. string dataDir = RunExamples.GetDataDir_ManageBarCodesImages(); // Instantiate barcode object and set CodeText & Barcode Symbology BarCodeBuilder builder = new BarCodeBuilder("1234567890", EncodeTypes.Code39Standard) { // Set auto size false, height and width AutoSize = false, ImageHeight = 50, ImageWidth = 120 }; builder.Save(dataDir + "barcode-custom-size_out.jpg"); // ExEnd:BarcodeCustomSize }
public static void Run() { // ExStart:Create2DBarcodes // The path to the documents directory. string dataDir = RunExamples.GetDataDir_CreateAndManage2DBarCodes(); // Instantiate barcode object and set CodeText & Barcode Symbology BarCodeBuilder barCodeBuilder = new BarCodeBuilder("this is some test code text. \n Second line \n third line.", EncodeTypes.Pdf417) { // Set width and height xDimension = 0.6f, yDimension = 1.2f }; // Save the Barcode image barCodeBuilder.Save(dataDir + "2d-barcode_out.jpg", BarCodeImageFormat.Jpeg); // ExEnd:Create2DBarcodes }
public static void Run() { // ExStart:OptionalExceptionMessageWith1DBarCode // Instantiate BarCodeBuilder object BarCodeBuilder builder = new BarCodeBuilder("348503498549085409", EncodeTypes.EAN13); try { // Error message will not been thrown in case of false, default value is also false and Get barcode image builder.ThrowExceptionWhenCodeTextIncorrect = true; Bitmap bitmap = builder.GenerateBarCodeImage(); } catch (Exception ex) { Console.WriteLine("Exception must be thrown, {0}", ex.Message); } // ExEnd:OptionalExceptionMessageWith1DBarCode }
public static void GS1DatamatrixBarcodeWithWrappingText() { //ExStart: GS1DatamatrixBarcodeWithWrappingText string CODICE = "(90)0843110730<<<<452287005001T8"; string displayedText = "(90)0843" + Environment.NewLine + "110730<<<<" + Environment.NewLine + "452287" + Environment.NewLine + "005001T8" + Environment.NewLine; using (BarCodeBuilder builder = new BarCodeBuilder(CODICE, EncodeTypes.GS1DataMatrix)) { builder.CodeLocation = CodeLocation.Right; builder.Display2DText = displayedText; Bitmap barcode = builder.GenerateBarCodeImage(); barcode.Save(dataDir + "Display2DText.png"); } //ExEnd: GS1DatamatrixBarcodeWithWrappingText }
public static void Run() { // The path to the documents directory. string dataDir = RunExamples.GetDataDir_CreateAndManage2DBarCodes(); // Instantiate barcode object BarCodeBuilder barCodeBuilder = new BarCodeBuilder(); // Set Barcode Symbology barCodeBuilder.SymbologyType = Symbology.Aztec; // Set CodeText barCodeBuilder.CodeText = "123456789"; // Save the Barcode image barCodeBuilder.Save(dataDir + "CreateAztecbarcode_out.bmp", BarCodeImageFormat.Bmp); Console.WriteLine(Environment.NewLine + "Barcode saved at " + dataDir + "CreateAztecbarcode_out.bmp"); }
public static void Run() { // The path to the documents directory. string dataDir = RunExamples.GetDataDir_ManageBarCodes(); // Instantiate BarCodeBuilder object BarCodeBuilder barCodeBuilder = new BarCodeBuilder(); // Set the SymbologyType for the barcode barCodeBuilder.SymbologyType = Symbology.DataMatrix; // Set the CodeText for the barcode barCodeBuilder.CodeText = "1234567890"; // Save file to disk barCodeBuilder.Save(dataDir + "datamatrix-barcode_out.jpg", BarCodeImageFormat.Jpeg); Console.WriteLine(Environment.NewLine + "Barcode saved at " + dataDir + "datamatrix-barcode_out.jpg"); }
public static void Run() { // ExStart:ColorizeAnyPartoftheBarcodeImage // The path to the documents directory. string dataDir = RunExamples.GetDataDir_ManageBarCodesImages(); string dst = dataDir + "colorize-barcode_out.jpg"; // Instantiate barcode object and differnt properties BarCodeBuilder barCodeBuilder = new BarCodeBuilder("1234567", EncodeTypes.Code128) { BackColor = Color.Yellow, ForeColor = Color.Blue, BorderColor = Color.Red, CodeTextColor = Color.Red }; barCodeBuilder.Save(dst, ImageFormat.Jpeg); // ExEnd:ColorizeAnyPartoftheBarcodeImage }
public static void Run() { // The path to the documents directory. string dataDir = RunExamples.GetDataDir_CreateAndManage2DBarCodes(); // Instantiate barcode object BarCodeBuilder barCodeBuilder = new BarCodeBuilder(); // Set Barcode Symbology barCodeBuilder.SymbologyType = Symbology.DataMatrix; // Set Data Matrix EncodeMode barCodeBuilder.DataMatrixEncodeMode = Aspose.BarCode.DataMatrixEncodeMode.ASCII; // set CodeText for barcode barCodeBuilder.CodeText = "This is the data to be encoded"; barCodeBuilder.Save(dataDir + "ManagePDF417Barcode_out.bmp", ImageFormat.Bmp); }
public static void Run() { // The path to the documents directory. string dataDir = RunExamples.GetDataDir_ProgrammingBarCode(); // Set codetext string codeText = "12345678"; // Initialize BarCodeBuilder BarCodeBuilder builder = new BarCodeBuilder(codeText, Symbology.AustraliaPost); // Set format control code to standard builder.AustraliaPostFormatControlCode = AustraliaPostFormatControlCode.Standard; // Save the image to disk in PNG format builder.Save(dataDir + "AustraliaPost-Standard.png"); // Set format control code to ReplyPaid builder.AustraliaPostFormatControlCode = AustraliaPostFormatControlCode.ReplyPaid; // Save the image to disk in PNG format builder.Save(dataDir + "AustraliaPost-ReplyPaid.png"); // Set format control code to Customer2 builder.AustraliaPostFormatControlCode = AustraliaPostFormatControlCode.Customer2; // Save the image to disk in PNG format builder.Save(dataDir + "AustraliaPost-Customer2.png"); // Set format control code to Customer3 builder.AustraliaPostFormatControlCode = AustraliaPostFormatControlCode.Customer3; // Save the image to disk in PNG format builder.Save(dataDir + "AustraliaPost-Customer3.png"); // Set format control code to Routing builder.AustraliaPostFormatControlCode = AustraliaPostFormatControlCode.Routing; // Save the image to disk in PNG format builder.Save(dataDir + "AustraliaPost-Routing.png"); // Set format control code to Redirection builder.AustraliaPostFormatControlCode = AustraliaPostFormatControlCode.Redirection; // Save the image to disk in PNG format builder.Save(dataDir + "AustraliaPost-Redirection.png"); Console.WriteLine(Environment.NewLine + "AustraliaPost Barcodes saved at " + dataDir); }