KA.Barcode for ASP.NET
How to Create & Resize Code 39 in ASP.NET
Complete source code to generate, print Code 39 images using Barcode Generator for ASP.NET Control
  • Simply integrate 1D Code 39 creation features into ASP.NET Web application
  • Programmatically generating, drawing Code 39, Code 39 Extension in C#.NET, VB.NET class library, ASP.NET website
  • Draw and print barcode .NET, barcode Java, barcode Word & barcode .NET WinForms in .NET IDEs
  • Dynamic Code 39 barcode generation and displaying in Microsoft IIS through parameter setting in URL
  • Generate, make Code 39 image and customize properties X and Y to set the width & height of the module bar
  • Present property WideNarrowRatio to set the width of the wide bar in 1D Bar Code 3 of 9
  • Support drawing, creating Code 39 images and adjust the width of surrounding margins and quiet zones
  • 3 units of measure - cm, inch, and pixel provided to resize the printout/ generated linear Code 39 barcodes
  • Provide detailed generation guides online, such as Java barcode guide, ASP.NET barcode creation & VB.NET barcode creation
  • Provide complete unencrypted source code with purchase
Code 39 barcode creator component API for ASP.NET C# & VB.NET provides user-defined option for users to manipulate Code 39 size, image, and human-readable text related properties in ASP.NET webform/ website with C#.NET, VB.NET programming. This page explains how to set Code 39 size in ASP.NET, IIS; other Code 39 setting tutorials with C# & VB.NET examples, please see:
Code 39 Barcode Structure
Code 39
Code 39 barcode (a.k.a USD-3, USS Code 39, Code 3/9, Code 3 of 9) is constructed of:
  • Left Quiet Zone
  • A start character - the asterisk (*) character
  • Message data
  • An optional checksum digit calculated on Modulo 43
  • A stop character - the asterisk (*) character
  • Right Quiet Zone
Code 39 Size Setting in ASP.NET with C#, VB.NET Programming

Install Code 39 Barcode Creator Webform Control into ASP.NET Projects

  1. 1.
  2. 2.
    Add reference: Add "KeepAutomation.Barcode.Web.dll" to your ASP.NET project reference
  3. 3.
    Add to toolbox: To add BarcodeControl to your ASP.NET toolbox
Copy those following C# or VB.NET barcode generator program onto you forms for creating Code 39 in ASP.NET:
using KeepAutomation.Barcode.Bean;
BarCode barcode= new BarCode();
barcode.Symbology= KeepAutomation.Barcode.Symbology.Code39;
barcode.CodeToEncode = "Code 39"
barcode.generateBarcodeToImageFile("C://barcode-code39-csharp.gif");
Dim barcode As KeepAutomation.Barcode.Bean.BarCode = New KeepAutomation.Barcode.Bean.BarCode

barcode.Symbology= KeepAutomation.Barcode.Symbology.Code39
barcode.CodeToEncode = "Code 39"
barcode.generateBarcodeToImageFile("C://barcode-code39-vbnet.gif")

Produce Code 39 Barcode with Speficied BarcodeUnit Property

BarcodeUnit (URL: barcode-unit; Default: Pixel): it is the unit measurement for all size related settings in Code 39 & Code 39 Extension barcodes. User may change it with "Pixel", "Inch" and "Cm". Replace sample code with following one:
barcode.BarcodeUnit = KeepAutomation.Barcode.BarcodeUnit.Pixel;
barcode.BarcodeUnit = KeepAutomation.Barcode.BarcodeUnit.Pixel

Develop Code 39 Barcode with Specified I Property

I (URL: i; Default: 1): it is the width of inter-character gap in Code 39 & Code 39 Extension barcodes. Replace sample code with following one:

Generate Code 39 Barcode with Fixed Wide to Narrow Bar Ratio

WideNarrowRatio(URL: wide-narrow-ratio; Default: 2.0): it is the proportion of wide bar and narrow in Code 39 & Code 39 Extension barcodes. Replace sample code with following one:
barcode.WideNarrowRatio = 2.5f;
barcode.WideNarrowRatio = 2.5f

Print Code 39 with Specified X and Y Properties

X (URL: x; Default: 1): it is the width of the narrow bar in Code 39 & Code 39 Extension barcodes.

Y (URL: y; Default: 50): it is the height of bars in Code 39 & Code 39 Extension barcodes.
barcode.X = 3;
barcode.Y = 75;
barcode.X = 3
barcode.Y = 75

Create Code 39 with Fixed BarCodeWidth and BarCodeHeight

BarCodeWidth (URL: barcode-width; Default: 0): it is the barcode width of Code 39 & Code 39 Extension barcodes.

BarCodeHeight (URL: barcode-height; Default: 0): it is the barcode height of Code 39 & Code 39 Extension barcodes.
barcode.BarCodeWidth = 200;
barcode.BarCodeHeight = 75;
barcode.BarCodeWidth = 200
barcode.BarCodeHeight = 75

Set Code 39 with Quite Margin Property

TopMargin (URL: top-margin; Default: 0): it is the barcode image top margin in Code 39 & Code 39 Extension barcodes.

BottomMargin (URL: bottom-margin; Default: 0): it is the barcode image bottom margin in Code 39 & Code 39 Extension barcodes.

LeftMargin (URL: left-margin; Default: 0): it is the barcode image left margin in Code 39 & Code 39 Extension barcodes.

RightMargin (URL: right-margin; Default: 0): it is the barcode image right margin in Code 39 & Code 39 Extension barcodes.
barcode.TopMargin = 8;
barcode.BottomMargin = 8;
barcode.LeftMargin = 6;
barcode.RightMargin = 6;
barcode.TopMargin = 8
barcode.BottomMargin = 8
barcode.LeftMargin = 6
barcode.RightMargin = 6
Code 39 Size Setting with Drag & Drop BarcodeControl into Webform
  1. 1.
    In "Choose Toolbox Items" form, click button "Browse...", and select KeepAutomation.Barcode.Web.dll
  2. 2.
    Now you'll see BarCodeControl in your toolbox
  3. 3.
    Drag and drop the BarCodeControl into the Forms and a Codabar image is generated
  4. 4.
    Find barcode setting panel, choose "Symbology" to "Code39" and write down encode data
  5. 5.
    Set "BarcodeUnit" to "Pixel", "I" to 3 and "WideNarrowRatio" to "2.5"
  6. 6.
    Set "X" to 3, "Y" to 72; Set "BarcodeWidth" to 200 and "BarcodeHeight" to 75
  7. 7.
    Set "TopMargin" & "BottomMargin" to 8; and set "RightMarign" & "LeftMargin" to 6
  8. 8.
    A Code 39 barcodes with different customized size appears
Code 39 Size Setting in Internet Information Service (IIS)
  1. 1.
    Copy folder "barcode" in your download the trial package to your IIS web application folder
  2. 2.
    Create a virtual directory, named "barcode", and link to your just copied "barcode" folder
  3. 3.
    Restart IIS and now you have successfully installed the ASP.NET Barcode Generator web application
  4. 4.
    To test it, open your web browser, and navigate to "http://localhost/barcode/barcode.aspx?symbology=4&code-to-encode=0123456789&barcode-unit=0&i=3&wide-narrow-ratio=2.5&x=3&y=75&barcode-width=200&barcode-height=75&top-margin=8&bottom-margin=8&left-margin=6&right-margin=6"
  5. 5.
    A Code 39 barcode with customized size occurs will be displayed