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_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_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_ProgrammingBarCode(); string dstCode128 = dataDir + "code128-YDimensionChanged.jpg"; string dstPdf417 = dataDir + "pdf417-YDimensionChanged.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; //Save the image to your system //and set its image format to Jpeg bb.Save(dstCode128, System.Drawing.Imaging.ImageFormat.Jpeg); //Set the X-Dimension for the bars of the barcode bb.xDimension = 0.5f; //Set the measuring unit of barcode to millimeter bb.GraphicsUnit = System.Drawing.GraphicsUnit.Millimeter; //Save the image to your system //and set its image format to Jpeg bb.Save(dstCode128, System.Drawing.Imaging.ImageFormat.Jpeg); //Instantiate barcode object BarCodeBuilder bb1 = new BarCodeBuilder(); //Set the Code text for the barcode bb1.CodeText = "1234567"; //Set the symbology type to Pdf417 bb1.SymbologyType = Symbology.Pdf417; //Set the Y-Dimension for the bars of the barcode bb1.yDimension = 4; //Save the image to your system //and set its image format to Jpeg bb1.Save(dstPdf417, System.Drawing.Imaging.ImageFormat.Jpeg); Console.WriteLine(Environment.NewLine + "Barcode saved at " + dstCode128); Console.WriteLine(Environment.NewLine + "Barcode saved at " + dstPdf417); }
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); }
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() { // 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-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_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_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_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_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) {} }
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 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 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 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_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_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_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_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(); // 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_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_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() { // 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: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(); // 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: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() { // The path to the documents directory. string dataDir = RunExamples.GetDataDir_ManageBarCodesImages(); // Instantiate barcode object and different properties BarCodeBuilder barCodeBuilder = new BarCodeBuilder("1234567890", EncodeTypes.Code128) { Margins = {Left = 0.5f, Right = 0f, Top = 0f, Bottom = 0f} }; barCodeBuilder.Save(dataDir + "barcode-image-margins_out.jpeg", ImageFormat.Jpeg); }
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); }
public static void Run() { // ExStart:SetCodeTextFontFamilyNameAndSize // 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); // ExEnd:SetCodeTextFontFamilyNameAndSize }
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("test123", Symbology.QR); // Set QR encode mode builder.QREncodeMode = QREncodeMode.Auto; // Save the file to disk builder.Save(dataDir + "QR-Encode-mode_out.jpg"); }
public static void Run() { // ExStart:ControlBarsFillingofOneDBarcodes // The path to the documents directory. string dataDir = RunExamples.GetDataDir_ManageBarCodesImages(); // Instantiate barcode object using (BarCodeBuilder builder = new BarCodeBuilder("TEXT", EncodeTypes.Pdf417)) { builder.FilledBars = false; builder.Save(dataDir + "ControlBarsFillingofOneDBarcodes_out.png"); } // ExEnd:ControlBarsFillingofOneDBarcodes }
public static void Run() { // The path to the documents directory. string dataDir = RunExamples.GetDataDir_ProgrammingBarCode(); string dstCode128 = dataDir + "code128-YDimensionChanged.jpg"; string dstPdf417 = dataDir + "pdf417-YDimensionChanged.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; //Save the image to your system //and set its image format to Jpeg bb.Save(dstCode128, System.Drawing.Imaging.ImageFormat.Jpeg); //Set the X-Dimension for the bars of the barcode bb.xDimension = 0.5f; //Set the measuring unit of barcode to millimeter bb.GraphicsUnit = System.Drawing.GraphicsUnit.Millimeter; //Save the image to your system //and set its image format to Jpeg bb.Save(dstCode128, System.Drawing.Imaging.ImageFormat.Jpeg); //Instantiate barcode object BarCodeBuilder bb1 = new BarCodeBuilder(); //Set the Code text for the barcode bb1.CodeText = "1234567"; //Set the symbology type to Pdf417 bb1.SymbologyType = Symbology.Pdf417; //Set the Y-Dimension for the bars of the barcode bb1.yDimension = 4; //Save the image to your system //and set its image format to Jpeg bb1.Save(dstPdf417, System.Drawing.Imaging.ImageFormat.Jpeg); Console.WriteLine(Environment.NewLine + "Barcode saved at " + dstCode128); Console.WriteLine(Environment.NewLine + "Barcode saved at " + dstPdf417); }
public static void Run() { //ExStart:CreateEnCodeDatamatrixBarCode // 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 the data to be encoded", EncodeTypes.DataMatrix); // Set Data Matrix EncodeMode barCodeBuilder.DataMatrixEncodeMode = DataMatrixEncodeMode.ASCII; barCodeBuilder.Save(dataDir + "ManagePDF417Barcode_out.bmp", ImageFormat.Bmp); //ExEnd:CreateEnCodeDatamatrixBarCode }
public static void Run() { // ExStart:SetCodetextLocation // 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); // ExEnd:SetCodetextLocation }
public static void Run() { //ExStart:ReduceCodeTextFontSize // 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); //ExEnd:ReduceCodeTextFontSize }
private void ReadIdentityEmployee() { Employee c = new Employee(); if (SelectedEmployee.Barcode != 0) { c.Barcode = SelectedEmployee.Barcode; } BEID_ReaderSet.initSDK(); // access the eID card here if (BEID_ReaderSet.instance().readerCount() > 0) { BEID_ReaderContext readerContext = readerContext = BEID_ReaderSet.instance().getReader(); if (readerContext != null) { if (readerContext.getCardType() == BEID_CardType.BEID_CARDTYPE_EID) { BEID_EIDCard card = readerContext.getEIDCard(); //BEID_Picture picture; //byte[] bytearray; //picture = card.getPicture(); //bytearray = picture.getData().GetBytes(); //c.Picture = bytearray; //c.Picture = StringToImageConverter.BitmapImageFromBytes(bytearray); //img.Height = 100; c.EmployeeName = card.getID().getFirstName() + " " + card.getID().getSurname(); c.Address = card.getID().getStreet() + " " + card.getID().getMunicipality(); c.Barcode = Int64.Parse(card.getID().getNationalNumber()); } } } BEID_ReaderSet.releaseSDK(); BarCodeBuilder bb = new BarCodeBuilder(); bb.CodeText = c.Barcode.ToString(); bb.SymbologyType = Symbology.Code128; bb.Save(c.EmployeeName + ".jpg", System.Drawing.Imaging.ImageFormat.Jpeg); SelectedEmployee = c; }
public static void Run() { // The path to the documents directory. string dataDir = RunExamples.GetDataDir_ManageBarCodes(); // Set codetext string codeText = "1159628792"; // Initialize BarCodeBuilder BarCodeBuilder builder = new BarCodeBuilder(codeText, EncodeTypes.AustraliaPost); // Set format control code to standard builder.Save(dataDir + "AustraliaPost-Standard_out.png"); }
public static void Run() { // ExStart:SetQRErrorCorrection // 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); // ExEnd:SetQRErrorCorrection }
public static void Run() { // ExStart:RotateBarcodeImage // The path to the documents directory. string dataDir = RunExamples.GetDataDir_ManageBarCodesImages(); // Instantiate barcode object and set CodeText, Barcode Symbology and RotationAngleF BarCodeBuilder barCodeBuilder = new BarCodeBuilder("1234567", EncodeTypes.Code128) { RotationAngleF = 180 }; barCodeBuilder.Save(dataDir + "barcode-image-rotate_out.jpeg", ImageFormat.Jpeg); // ExEnd:RotateBarcodeImage }
public static void Run() { // ExStart:BarcodeImageMargins // The path to the documents directory. string dataDir = RunExamples.GetDataDir_ManageBarCodesImages(); // Instantiate barcode object and different properties BarCodeBuilder barCodeBuilder = new BarCodeBuilder("1234567890", EncodeTypes.Code128) { Margins = { Left = 0.5f, Right = 0f, Top = 0f, Bottom = 0f } }; barCodeBuilder.Save(dataDir + "barcode-image-margins_out.jpeg", ImageFormat.Jpeg); // ExEnd:BarcodeImageMargins }
public static void Run() { // ExStart:SetQREncodeMode // 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"); // ExEnd:SetQREncodeMode }
public static void Run() { // ExStart:BarcodeImageQuality // The path to the documents directory. string dataDir = RunExamples.GetDataDir_ManageBarCodesImages(); // Instantiate barcode object and set CodeText, Barcode Symbology and image quality mode to anti alias BarCodeBuilder barCodeBuilder = new BarCodeBuilder("1234567", EncodeTypes.Code128) { ImageQuality = ImageQualityMode.AntiAlias }; barCodeBuilder.Save(dataDir + "barcode-image-quality_out.jpeg", ImageFormat.Jpeg); // ExEnd:BarcodeImageQuality }
public static void Run() { // ExStart:DisplayChecksumCharacter // The path to the documents directory. string dataDir = RunExamples.GetDataDir_ManageBarCodes(); // Instantiate barcode object and set Always show checksum on image BarCodeBuilder barCodeBuilder = new BarCodeBuilder("0123456789", EncodeTypes.Code39Standard) { AlwaysShowChecksum = true }; barCodeBuilder.Save(dataDir + "DisplayChecksumCharacter_out.png"); // ExEnd:DisplayChecksumCharacter }
public static void Run() { //ExStart:CustomEncodingModeInDataMatrix // The path to the documents directory. string dataDir = RunExamples.GetDataDir_CreateAndManage2DBarCodes(); // Instantiate barcode object and set CodeText & Barcode Symbology BarCodeBuilder barCodeBuilder = new BarCodeBuilder("öäüéà è", EncodeTypes.DataMatrix); // Set Data Matrix EncodeMode to Custom and CodeText Encoding Property barCodeBuilder.DataMatrixEncodeMode = DataMatrixEncodeMode.Custom; barCodeBuilder.CodeTextEncoding = Encoding.UTF8; barCodeBuilder.Save(dataDir + "CustomEncodingModeInDataMatrix_out.bmp", ImageFormat.Bmp); //ExEnd:CustomEncodingModeInDataMatrix }
public static void Run() { //ExStart:CreateSimpleDatamatrixBarCode // 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.DataMatrix); // Width of each module and Save the Barcode image barCodeBuilder.xDimension = 0.6f; barCodeBuilder.Save(dataDir + "Datamatrixbarcode_out.bmp", BarCodeImageFormat.Bmp); Console.WriteLine(Environment.NewLine + "Barcode saved at " + dataDir + "Datamatrixbarcode_out.bmp"); //ExEnd:CreateSimpleDatamatrixBarCode }
public HttpResponseMessage GetByProductId(string id) { string uploadPath = ""; //uploadPath = HttpContext.Current.Server.MapPath("~/BarcodeImages"); //uploadPath = ConfigurationManager.AppSettings["BarcodeImages"]; uploadPath = Path.GetTempPath(); bool exists = Directory.Exists(uploadPath); if (!exists) { Directory.CreateDirectory(uploadPath); } string filename = uploadPath + "/" + id + ".png"; if (File.Exists(filename)) { File.Delete(filename); } BusinessDbContext businessDbContext = BusinessDbContext.Create(); var repository = new BaseRepository <ProductDetail>(businessDbContext); var service = new ProductDetailService(repository); var model = service.GetById(id); BarCodeBuilder builder = new BarCodeBuilder(model.BarCode); string text = $"{model.Name} \n MRP: {model.SalePrice} Tk"; Caption captionBelow = new Caption(text) { TextAlign = StringAlignment.Center, Font = new Font(FontFamily.GenericSansSerif, 10, FontStyle.Bold) }; builder.CaptionBelow = captionBelow; builder.Save(filename, ImageFormat.Png); var response = new HttpResponseMessage(HttpStatusCode.OK); //Stream stream = new FileStream(filename, FileMode.Open); Stream stream = new MemoryStream(File.ReadAllBytes(filename)); response.Content = new StreamContent(stream); response.Content.Headers.ContentType = new MediaTypeHeaderValue("image/png"); if (File.Exists(filename)) { File.Delete(filename); } return(response); }
public static void Run() { // ExStart:RotateBarcode // The path to the documents directory. string dataDir = RunExamples.GetDataDir_ManageBarCodesImages(); // Instantiate barcode object and set CodeText, Barcode Symbology and hide code text BarCodeBuilder barCodeBuilder = new BarCodeBuilder("1234567890", EncodeTypes.QR) { CodeLocation = CodeLocation.None, RotationAngleF = 90 }; barCodeBuilder.Save(dataDir + "QR-rotate_out.jpeg", BarCodeImageFormat.Jpeg); // ExEnd:RotateBarcode }
public static void Run() { // ExStart:CreateUpcaGs1DatabarCoupon // The path to the documents directory. string dataDir = RunExamples.GetDataDir_ManageBarCodes(); // Instantiate barcode object and set CodeText & Barcode Symbology BarCodeBuilder barCodeBuilder = new BarCodeBuilder("512345678900(8110)001234502239811110555", EncodeTypes.UpcaGs1DatabarCoupon) { // Set barcode caption and barcode CaptionAbove = { Text = "012345-022398" } }; barCodeBuilder.Save(dataDir + "couponUpcaDatabar_out.png"); // ExEnd:CreateUpcaGs1DatabarCoupon }
public static void Run() { // The path to the documents directory. string dataDir = RunExamples.GetDataDir_ManageBarCodesImages(); // Instantiate barcode object BarCodeBuilder barCodeBuilder = new BarCodeBuilder(); // Set Code text font's type and size barCodeBuilder.CodeTextFont = new System.Drawing.Font("Verdana", 12f); // Save barcode image to file barCodeBuilder.Save(dataDir + "SetCodeTextFontFamilyNameAndSize_out.bmp", System.Drawing.Imaging.ImageFormat.Bmp); Console.WriteLine(Environment.NewLine + "Barcode saved at " + dataDir); }
public static void Run() { // The path to the documents directory. string dataDir = RunExamples.GetDataDir_ManageBarCodes(); // Instantiate barcode object BarCodeBuilder barCodeBuilder = new BarCodeBuilder("0123456789", Symbology.Code39Standard); // Always show checksum on image barCodeBuilder.AlwaysShowChecksum = true; // Save file to disk barCodeBuilder.Save(dataDir + "DisplayChecksumCharacter_out.png"); Console.WriteLine(Environment.NewLine + "Barcode saved at " + dataDir + "DisplayChecksumCharacter.png"); }
public static void Run() { // The path to the documents directory. string dataDir = RunExamples.GetDataDir_ManageBarCodes(); // Set codetext string codeText = "1234"; // Initialize BarCodeBuilder BarCodeBuilder builder = new BarCodeBuilder(codeText, Symbology.Code128); // Code128 type handles Code A, B and C character sets automatically // Save the image to disk in PNG format builder.Save(dataDir + "Code128-customized_out.png"); }
public static void Run() { // ExStart:SetWideNarrowRatio // The path to the documents directory. string dataDir = RunExamples.GetDataDir_ManageBarCodes(); // Set the symbology and code text and X dimension reduction property of barcode and save barcode Image BarCodeBuilder barCodeBuilder = new BarCodeBuilder("blackReduction", EncodeTypes.Code128) { xDimension = 1.2f, BarWidthReduction = 0.2f }; barCodeBuilder.Save(dataDir + "SetWideNarrowRatio_out.png"); // ExEnd:SetWideNarrowRatio }
public static void Run() { // The path to the documents directory. string dataDir = RunExamples.GetDataDir_ManageBarCodesImages(); // Instantiate barcode object BarCodeBuilder barCodeBuilder = new BarCodeBuilder(); // Increase the space between code text and barcode to 1 point barCodeBuilder.CodeTextSpace = 1.0f; // Save barcode image to file barCodeBuilder.Save(dataDir + "AddSpaceInBarCodeAndText_out.bmp", System.Drawing.Imaging.ImageFormat.Bmp); Console.WriteLine(Environment.NewLine + "Barcode saved at " + dataDir); }
public static void Run() { // The path to the documents directory. string dataDir = RunExamples.GetDataDir_CreateAndManage2DBarCodes(); // Create instance of BarCodeBuilder class BarCodeBuilder builder = new BarCodeBuilder("1234567890", Symbology.Pdf417); // Set Aspect Ratio to 3:2 or 1.5 builder.AspectRatio = 1.5f; // Save the barcode image to disk in PNG format builder.Save(dataDir + "SetAspectRatio_out.png", BarCodeImageFormat.Png); }
public static void Run() { // ExStart:ChecksumSupplementData // The path to the documents directory. string dataDir = RunExamples.GetDataDir_ManageBarCodes(); // Instantiate barcode object BarCodeBuilder barCodeBuilder = new BarCodeBuilder("1234567", EncodeTypes.Code39Standard) { // Make the checksum to be visible on the barcode EnableChecksum = EnableChecksum.Yes }; barCodeBuilder.Save(dataDir + "code39-checeksum_out.png"); // ExEnd:ChecksumSupplementData }
public static void Run() { // ExStart:SetCodeAlignment // The path to the documents directory. string dataDir = RunExamples.GetDataDir_ManageBarCodesImages(); // Instantiate barcode object and set differnt Properties BarCodeBuilder barCodeBuilder = new BarCodeBuilder { CodeText = "1234567", CodeTextAlignment = StringAlignment.Center }; barCodeBuilder.Save(dataDir + "barcode-SetCodeAlignment_out.jpg", ImageFormat.Jpeg); // ExEnd:SetCodeAlignment }
public static void Run() { //ExStart:UseAztecErrorCorrection // The path to the documents directory. string dataDir = RunExamples.GetDataDir_CreateAndManage2DBarCodes(); // Instantiate barcode object and set Barcode CodeText & Symbology BarCodeBuilder barCodeBuilder = new BarCodeBuilder("123456789", EncodeTypes.Aztec) { // Set Error Error Correction level and Save the Barcode image AztectErrorLevel = 10 }; barCodeBuilder.Save(dataDir + "UseAztecErrorCorrection_out.bmp", BarCodeImageFormat.Bmp); //ExEnd:UseAztecErrorCorrection }
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); }