C# Barcode Generator Library
How to create barcode to HTML web file?


How to use C# to create barcodes to html file in ASP.NET Core, MVC, WinForms, WPF apps?













How to customize barcode module, background, text color using C#?


You can easily generate and customize barcode module color, barcode background color, and displayed text colors using C# barcode generator library.

  1. Create a new Linear object with barcode format, data to encode options applied
  2. Use property ForeColor to render the barcode module color to Color.Red
  3. Use property BackColor to render the barcode background color to Color.Blue
  4. Use property TextColor to paint the barcode displayed text label color to Color.Red
  5. Save the barcode to a file path in png image format



            Linear barcode = new Linear();
            barcode.Type = BarcodeType.CODE128;
            barcode.Data = "ABC-12345-abc";

            barcode.ForeColor = Color.Red;
            barcode.BackColor = Color.Blue;

            barcode.TextColor = Color.Red;

            barcode.DrawBarcode(@"C:\Output\RasterEdge.com\demo-create-barcode-customize-colors.png", OutputFileType.PNG);








How to create barcode with transparent background in C#?


C# barcode library supports generating barcode images with transparent backgroud.

Right now the web browser supports png image format with transparent background.

            Linear barcode = new Linear();
            barcode.Type = BarcodeType.CODE128;
            barcode.Data = "ABC-12345-abc";

            barcode.ForeColor = Color.Red;
            barcode.BackColor = Color.Transparent;

            barcode.TextColor = Color.Red;

            barcode.DrawBarcode(@"C:\Output\RasterEdge.com\demo-create-barcode-customize-background-transparent.png", OutputFileType.PNG);








How to create barcode with transparent background in C#?


Sometimes you need create high or low resolution (dpi) barcode image for printing. You can apply the barcode image resolution setting through property Resolution in C# program.



barcode.Resolution = 1200;






How to generate barcode in Raster image formats in C#?


XImage Barcode Generator library supports generating and encoding barcode images in BITMAP, GIF, JPG (JPEG), PNG, TIF (TIFF) raster image formats.

You can apply the raster image format options through OutputFileType option during barcode creating in C# code.



            Linear barcode = new Linear();
            barcode.Type = BarcodeType.CODE128;
            barcode.Data = "ABC-12345-abc";

            barcode.DrawBarcode(@"C:\Output\customize-raster-image-format.png", OutputFileType.PNG);






How to generate barcode in Vector image formats in C#?


Besides raster images, barcode library also supports barcode generation in vector image format using C#.

You can create barcode in SVG format, and insert, displayed it in web browser. You can also generate, encode barcode in EPS format, and render it in Adobe applications, such as Acrobat.



Create Barcode in SVG


You can apply the SVG format options through OutputFileType option during barcode creating in C# code.



            Linear barcode = new Linear();
            barcode.Type = BarcodeType.CODE128;
            barcode.Data = "ABC-12345-abc";

            barcode.DrawBarcode(@"C:\Output\customize-vector-image-format-svg.svg", OutputFileType.SVG);


Create Barcode in EPS


You can apply the EPS format options through OutputFileType option during barcode creating in C# code.



            Linear barcode = new Linear();
            barcode.Type = BarcodeType.CODE128;
            barcode.Data = "ABC-12345-abc";

            barcode.DrawBarcode(@"C:\Output\customize-vector-image-format-eps.eps", OutputFileType.EPS);