ASP Barcode Component for IIS Tutorial
 
The IDAutomation ASP Barcode Server for IIS adds barcode generation capability
to Microsoft Windows Server 2000 and greater. These barcodes are streamed to
Internet web browsers without saving temp images on the server.
The barcode is created in an application as a dynamic IMG tag and is modified
from parameters passed. After installation, the barcode server can generate
barcodes via the web in any application and on any operating system as a dynamic
IMG tag. If a barcode scanner is not available for testing, consider these
hand-held barcode scanner
kits.
This product tutorial outlines installation for the
Linear ASP Barcode Server for IIS. If installing GS1 DataBar or Linear +
2D versions, please consider the difference in file names.
- From the web server, determine which
Virtual Directory the streaming
barcode application will generate images from. The
Virtual Directory is mapped
to a physical directory that will be part of the URL used to acquire
the barcode. If creating a separate Virtual Directory to generate
barcodes, use "idautomation".
- Extract all files from the IDAutomation_LinearASPSetup.zip
package. IDAutomation_LinearASPSetup.zip
will contain the following files:
| File Name |
Virtual Directory |
Copy to GAC |
| IDAutomationStreamingLinear.aspx |
idautomation\ |
|
| LinearStreamCS.dll |
idautomation\bin\ |
|
| IDAutomation.LinearServerControl.dll |
idautomation\bin\ |
Yes |
- Copy files ending in aspx to the
root of the Virtual Directory. This page will be accessed to generate
barcodes.
- If it does not already exist, create a folder in the Virtual Directory named
"bin" and copy files ending in dll to that directory.
- Many configurations of IIS on Windows Server 2003 R2, Windows Server
2008 and Vista require the server control files to reside in the Global
Assembly Cache (GAC). Open two instances of Windows Explorer. In one,
choose the files ending in ServerControl.dll
(ex: IDAutomationLinearServerControl.dll).
In the other, navigate to C:\Windows\Assembly and copy the files into
the Assembly folder. Explorer must be used to copy the files from one
window to the other.
- To verify the project is working correctly, view the streaming page
in the browser from the local machine; for example:
http://localhost/idautomation/IDAutomationStreamingLinear.aspx If the barcode does not appear, carefully repeat the above steps.
- The barcode may now be created in another application as an IMG
tag from parameters passed; for example:
<img src="http://yourserver.com/idautomation/IDAutomationStreamingLinear.aspx?barcode=123456789012&H=1.7"/>
Parameters in the URL of streaming barcode products determine the data that is encoded
as well as other properties. To transition from the examples provided, replace
http://www.bcgen.com/demo/linear-dbgs.aspx
with the unique URL of your streaming barcode generation product.
Following are some
implementation examples:
ASP
HTML
PHP
Reporting Applications
JavaScript and Web Applications
IDAutomation recommends using default values for all properties, unless requirements dictate otherwise.
General Barcode Properties for all Symbologies
|
Parameters used in the
Java Barcode Package, Hosted Barcode Generator Service
and the
ASP Barcode Server for IIS are also compatible with this product.
All parameters are uppercase; true and false parameter values should
be specified as either "T" or "F." |
|
Property Name |
Parameter |
Default |
Property
Description |
| Apply
Tilde |
PT |
F |
When True in Code 128 with the
Auto character set, the format ~???
may be used to specify the
ASCII code
of the character to be encoded and several other
ApplyTilde Barcode
Options are enabled. |
| Background Color |
BGC |
White |
The color of the canvas background |
| Bar Color |
BC |
Black |
The color of the barcode. |
| Bar Height |
BH |
1 |
The height of the
barcode in
centimeters (CM). 2.54 CM equals one inch. |
| Caption Above |
CA |
Null |
When text appears in this property,
it is displayed in the margin above the symbol. |
| Caption Below |
CB |
Null |
When text appears in this property,
it is displayed in the margin below the symbol. |
| Caption Top Font |
CTF |
Arial |
The font type used for top caption. |
| Caption Bottom Font |
CBF |
Arial |
The font type used for bottom
caption. |
| Caption Font Color |
CFC |
Black |
The font color
used for captions. |
| Caption Top Color |
CTC |
Black |
The font color
used for top caption. |
| Caption Bottom Color |
CBC |
Black |
The
font color used for bottom caption. |
| Caption Font Size |
CFS |
10 |
The size of the font used in
captions. |
| Caption Top Size |
CTS |
10 |
The size of the font used in
top caption. |
| Caption Bottom Size |
CBS |
10 |
The size of the font used in
bottom caption. |
| Caption Top Alignment |
CTA |
Center |
The alignment of the top caption.
Valid values are: Near, Center, and Far. |
| Caption Bottom Alignment |
CBA |
Center |
The alignment of the bottom caption.
Valid values are: Near, Center, and Far. |
| Check
Character |
CC |
T |
Automatically adds the check
digit to the barcode when true. The check digit is required for
all symbologies except Code 39, Industrial 2 of 5 and Codabar. When
using symbologies that do not require the check digit, the check
digit may be disabled. |
| Check
Character in Text |
CT |
F |
Check Character
in Text automatically adds the check digit that is encoded
in the barcode to the human readable text that is displayed when
true. |
| DataToEncode |
D |
123456789012 |
The data that is to be encoded
in the barcode symbol. |
| Image Type |
I |
GIF |
The type of image to be created;
JPEG, GIF, and 1BMP(One Bit Per Pixel) are supported. |
| Left
Margin |
LM |
0.2 |
The space of the left margin
in
centimeters. |
| Narrow
to Wide Ratio |
N |
2.0 |
The narrow to
wide ratio of symbologies that only contain narrow and wide
bars such as Code 39, Interleaved 2 of 5 and MSI. Common values
are 2, 2.5 and 3. |
| Orientation |
O |
0 |
Orientation indicates the orientation
of the barcode. Valid values are 0, 90, 180 and 270. |
| Resolution |
IR |
96 |
The resolution of the image measured
in dots per inch (DPI). |
| ShowText |
ST |
T |
When true, the human readable
text will be displayed with the barcode. |
| Text Above |
TA |
F |
When TA and ST are both true,
the human-readable text is placed above the barcode. |
| Top
Margin |
TM |
0.2 |
The top margin in
centimeters. |
| XDimension in CM |
X |
0.03 |
The width in
centimeters of the narrow bars. The X dimension should be increased
if the barcode scanner
being used does not dependably decode the symbol. The X dimension
may only be adjusted in increments of .03cm (12mils) unless
ImageResolution
is increased. |
| XDimension
in MILS |
M |
12 |
The width in mils (1/1000 of
an inch) of the narrow bars. The X dimension should be increased
if the barcode scanner used does not dependably decode the symbol. |
Linear-Specific
Barcode Properties
|
IDAutomation recommends using default values
for all properties, unless requirements dictate otherwise. |
|
Property Name |
Parameter |
Default |
Property Description |
| BearerBar
Horizontal |
BBH |
0 |
The width of the horizontal bearer
bars as a multiple of the XDimension; valid options are 0-10. |
| BearerBar
Vertical |
BBV |
0 |
The width of the vertical bearer
bars as a multiple of the XDimension; valid options are 0-10. |
| Character
Grouping |
CG |
0 |
Determines the number of characters
between spaces in the text interpretation of the data encoded in
the barcode. Supported values are 0 (which disables grouping), 3,
4 and 5. |
| Code
128 Set |
CS |
0 |
The set of characters to be used
for Code 128.
Valid values are: Auto, A, B or C. Valid streaming
parameter values are: Auto=0, A=1, B=2 or C=3. |
| Font |
F |
Times New Roman |
The font type
used for human readable text. |
| Font Color |
FC |
Black |
The font color
used for human readable text. |
| Font Size |
FS |
10 |
The font size
used for human readable text. |
| SymbologyID |
S |
Code128 |
A number that selects the symbology or
barcode type.
0=Code 39 1=Code 39 ASCII
2=Interleaved 2 of 5
3=Code 11
4=Codabar 5=MSI |
6=UPC-A
7=Industrial 2 of 5
8=Matrix 2 of 5
9=Code 93
10=EAN-13 11=EAN-8 |
12=UPC-E
13=Code 128
14=Planet
15=Postnet
16=Telepen
18=IntelligentMail
|
|
| Text Margin |
EM |
0.03 |
Sets the distance between the
symbol and the text in
centimeters. |
| White
Bar Increase |
WI |
0 |
A decimal percentage value that
increases the white space between bars to improve readability. For
example, a value of .25 increases the white space by 25%. Common
values are .10, .15, .20 and .25.
* |
DataMatrix-Specific
Barcode Properties
|
IDAutomation recommends using default
values for all properties, unless requirements dictate otherwise. |
|
Property Name |
Parameter |
Default |
Property Description |
| Process Tilde
|
PT |
T |
When set to "Yes", the tilde
(~) will be processed as explained in the
Data Matrix FAQ and the format ~d???
may be used to specify the
ASCII code
of the character to be encoded. For example, "ECC-200~d009Data-Matrix"
encodes "ECC-200 <TAB> Data-Matrix". |
| Encoding Mode
|
MODE |
3 |
The
Encoding Mode for data being encoded. Valid parameters
are 0=E_ASCII, 1=E_C40, 2=E_TEXT and 3=E_BASE256.
|
| Preferred Format
|
PFMT |
0 |
Sets the
preferred format represented by a number; valid values are from
1 (10X10) to 24 (144X144) and from 25 (8X18) to 30 (16X48); the
default value of '0' is used for automatic formatting.
If the component needs more space to create the symbol,
this property will be ignored. |
| X Dimension |
X |
0.06 |
The width in
centimeters of the squares that make up the symbol. This value
may need to be increased if the scanner cannot read symbols with
small X dimensions. When working with a
2D barcode scanner,
this value may be decreased to create a smaller symbol. |
PDF417-Specific Barcode Properties
|
IDAutomation recommends using default
values for all properties, unless requirements dictate otherwise. PDF417 FAQ |
|
Property Name |
Parameter |
Default |
Property Description |
| ApplyTilde |
PT |
T |
When true, the format
~??? may be used to specify the
ASCII code
of the character to be encoded. Commonly used ASCII codes are ~009,
which is a tab function, and ~013, which is a return function. |
| PDFErrorCorrectionLevel |
ECL |
0 |
The Reed Solomon
error correction level encoded in the symbol. More error correction
creates a larger symbol that can withstand more damage. The
default setting of 0 performs automatic selection. |
| MacroPDFEnable
|
MAE |
F |
When true, indicates
that this barcode is part of a
MacroPDF
sequence. |
| MacroPDFFileID
|
MAF |
0 |
Assigns a file
ID to the
MacroPDF
barcode. Each barcode in the
MacroPDF
sequence must have the same file id assigned to it. Valid options
are 0-899. |
| MacroPDFSegmentIndex
|
MAS |
F |
The index number
of each
MacroPDF
symbol must have a unique segment index, starting at zero and incrementing
thereafter by one. |
| MacroPDFLastSegment
|
MAL |
F |
When true, indicates that this
is the final barcode in the MacroPDF sequence. |
| PDFColumns |
COL |
0 |
The number of data columns in
the PDF417 barcode. When this is left at zero (0) the control will
automatically adjust this parameter internally. |
| PDFMode |
MODE |
Binary |
The
mode
of compaction used to encode data in the symbol. When set to
"Text," a smaller symbol may be created. Text mode encodes all characters
on the US keyboard plus returns and tabs. |
| PDFRows |
ROWS |
0 |
Sets the number
of rows. It is recommended to leave this property at 0, the default.
|
| Truncated |
TRN |
F |
A truncated PDF417
symbol is more area efficient than normal PDF417. When true, the
right hand side of the PDF417 is removed or truncated.
|
| XtoYRatio |
XYR |
3 |
The X multiple height of individual
cells; default = 3. |
MaxiCode-Specific Barcode Properties
|
IDAutomation recommends using default
values for all properties, unless requirements dictate otherwise. |
|
Name |
Parameter |
Default |
Description |
| When using Maxicode
in modes 2 or 3
for UPS and other transportation applications, the
Service Class, Country Code and Zip Code must be
included in the DataToEncode (D Parameter) as defined in the
MaxiCode FAQ. |
| ApplyTilde |
PT |
T |
When true, the format ~ddd may
be used to specify the
ASCII code
of the character to be encoded as explained in the
MaxiCode FAQ. A setting of "False" will disable ApplyTilde. |
| EncodingMode |
M |
Mode2 |
The
mode of compression and encoding used in the symbol. Modes 2
and 3 are designed for use in the transport industry. Mode 4 encodes
up to 93 characters or 138 digits. Mode 5 encodes up to 77 characters
and provides more error correction capabilities than mode 4. Mode
6 indicates that the symbol encodes a message used to program a
reader system (scanner). |
Aztec-Specific Barcode Properties
|
IDAutomation recommends using default values
for all properties, unless requirements dictate otherwise. |
|
Property Name |
Parameter |
Default |
Property Description |
| Process Tilde
|
PT |
F |
When true, the tilde (~) will
be processed and the format ~d???
may be used to specify the
ASCII code
of the character to be encoded. For example, "AZTEC~d009CODE" encodes
"AZTEC <TAB> CODE." |
| Error Correction
Level |
ECL |
0 |
The
Reed Solomon error correction level encoded in the symbol, specified
as a value from 1 to 99. More error correction creates a larger
symbol that can withstand more damage. The default setting
of 0 performs automatic selection, which is usually a value of 23.
|
| MessageAppend
|
MA |
na |
Specifies the message
appended across multiple symbols. Only valid if NumberOfSymbols
is greater than 1. |
| NumberOfSymbols |
NS |
1 |
Invokes MessageAppend
across symbols. |
| ReaderInitialization |
RI |
F |
Adds the reader initialization
symbol to the barcode for older scanners, which require it. |
| X Dimension |
X |
0.06 |
The width in
centimeters of the squares that make up the symbol. This value
may need to be increased if the scanner cannot read symbols with
small X dimensions. When working with a
2D barcode scanner,
this value may be decreased to create a smaller symbol. |
QR Code-Specific Barcode
Properties
|
IDAutomation recommends using default values
for all properties, unless requirements dictate otherwise. |
|
Property Name |
Parameter |
Default |
Property Description |
| Process Tilde
|
PT |
F |
When set to "True,"
the format ~d??? may be used
to specify the
ASCII code of the character to be encoded. Commonly used ASCII
codes are ~d009, which is a tab function and ~d013, which is a return
function. |
| EncodingMode |
MODE |
B |
The
mode of compaction used to encode data in the symbol.
Valid values are "B"(Byte),"A"(Alphanumeric), and "N"(Numeric) mode. |
| Version |
V |
0 |
Sets the
size of the symbol with valid values from 1 (21X21) to 40 (177X177). A default value of "0" is used for automatic formatting. |
| Error Correction
Level |
ECL |
M |
The
error correction level encoded in the symbol. Valid values are
L, M, Q, H. Higher error correction creates a larger symbol that
can withstand more damage. |
| X Dimension |
X |
0.06 |
The width in
centimeters of the squares that make up the symbol. This value
may need to be increased if the scanner cannot read symbols with
small X dimensions. When working with a
2D barcode scanner,
this value may be decreased to create a smaller symbol. |
DataBar, Composite and
MicroPDF417 Barcode Properties
|
IDAutomation recommends using default values
for all properties, unless requirements dictate otherwise.
MicroPDF417
Properties |
|
Property Name |
Parameter |
Default |
Property Description |
| Process Tilde
|
PT |
F |
When set to "True,"
the format ~d??? may be used
to specify the
ASCII code of the character to be encoded. Commonly used ASCII
codes are ~d009, which is a tab function and ~d013, which is a return
function. |
| CompositeData
|
CD |
Null |
The composite data to be encoded
above the linear barcode; however, not applicable when using PDF417
or MicroPDF417. |
| ExpandedStackedSegments |
SG |
22 |
Number of segments in a
DataBar Expanded symbol. A low, even number such as 4 or 6 creates
a
stacked symbol. |
| IncludeAIinHRText
|
AI |
True |
When true, the implied AI is
displayed in the human-readable text. DataBar-14 contains an implied
AI of (01). |
IncludeLinkageFlagin
HRText |
L |
False |
When true, the Linkage
Flag for the barcode is displayed in the human readable text. The
linkage flag determines if there is a 2D composite barcode to go
along with the linear DataBar barcode. |
| PDFErrorCorrectionLevel |
ECL |
0 |
The
Reed
Solomon error correction level encoded in the symbol. More error
correction creates a larger symbol that can withstand more damage.
The default setting of 0 performs automatic selection. |
| PDFColumns |
COL |
3 |
The number of data columns in
the PDF417 barcode. The default is 3 and the maximum is 30. |
| PDFMode |
MODE |
Text |
The
mode
of compaction used to encode data in the symbol. When set to
"Text," a smaller symbol may be created. Text mode encodes all characters
on a US keyboard, plus returns and tabs. |
| SymbologyID |
S |
1 or DATABAR |
This is the type of symbology
to be used. When using DataBar (RSS), the data must be formatted according to the
GS1 DataBar & Composite FAQ.
0=CODE128
1=DATABAR
2=DATABAREXPANDED
3=DATABARLIMITED
4=DATABARSTACKED
5=DATABAROMNI
6=DATABARTRUNCATED |
7=EAN13
8=EAN8
9=MICROPDF417
10=PDF417
11=UPCA
12=UPCE |
|
| Text
Margin |
EM
|
0.03 |
Sets the distance between the
symbol and the text in
centimeters. |
| XtoYRatio |
XYR |
0.06 |
The X multiple height of individual
cells; the acceptable range is 2 to 5. |
Additional properties may be changed
in code if necessary when implementing
Streaming Mode for ASP.NET Project
Integration.
The default resolution generated barcode images is 96 DPI which allows
the image to be displayed properly in a web browser although it may
be necessary to increase the resolution of the image for printing purposes.
This can be easily accomplished in Server Control Mode by changing the
ImageResolution
property. Increasing the resolution in Streaming Mode can cause the image to display proportionally larger in the
browser. To resolve this issue in Streaming Mode, the size of the image may be
reduced or expanded
using HTML.
Technical Support Issues
Free product support may be obtained by reviewing the knowledgebase articles
that are documented below and by searching resolved
public forum threads.
Priority phone, email and forum support is also provided within 30 days of purchase.
Additional phone, email and forum support is provided with an active
Priority Support
and Upgrade Subscription.
Common Support Issues for ASP Barcode Server Component for IIS
Creating a Virtual Directory
in Windows 2000 Server
- Using Windows Explorer, create a physical directory below the
website directory that will be part of the URL. Example: c:\Inetpub\wwwroot\IDAutomation
- Open Internet Information Services or Information Services Manager
(IIS). This tool can be found under Administrative Tools.
- Right-click Default Web site and choose New - Virtual
Directory.
- Click Next on the Welcome screen of the Virtual Directory
Creation Wizard.
- Enter an Alias name that maps a physical directory that
will be part of the URL. Example:
http://www.mydomain.com/IDAutomation.
- Choose Next and Browse to the physical directory created
earlier.
- Select the physical directory, choose Next to grant the
default permissions and click Finish.
Error - "Server
Error in Application" Runtime Error:
- The error may look similar to this:
Server
Error in '/' Application.
Runtime Error
Description: An application error occurred
on the server.
Details: To enable the details...
<! -- Web.Config Configuration File --> |
- This error is generated when the directory that IDAutomationStreamingLinear.aspx
is being run from is not set up as a virtual directory under IIS with
the ability to run applications.
Error - "Server
Error in Application" Parser Error:
- The error may look similar to this:
Server
Error in '/' Application.
Parser Error
Description: An error occurred during
the parsing of a resource required to service this request.
Please review the following specific parse error details and
modify the source file appropriately.
Parser Error Message: File or assembly name IDAutomation.LinearServerControl,
or one of its dependencies, was not found. |
- If this error is received in
ASP.NET Project Integration,
a reference to the server control DLL was not found. Add a reference
to the IDAutomation Server Control in the project. For example: Right
Click on References, Choose Browse and select the server control DLL.
When a Developer License is purchased with a signed
Source Code
Agreement, the ASP.NET solution of streaming DLLs can be provided
for custom integration, modification and code-behind in ASP.NET. When using
products other than the linear version in this example, the difference in
file names should be considered.
- Extract all files from the package.
- After the files are extracted, additional ZIP files will be found
in the destination directory. Extract all files from the zip ending
in CS as the IDAutomation_StreamingLinear_CS.zip
is used for a C# project.
- Locate the image generating web page .aspx file from the extracted
files. Copy this file and all associated files to the ASP.NET project
directory. The image generating ASP.NET page for the linear control
is IDAutomationStreamingLinear.aspx and
its associated files are IDAutomationStreamingLinear.aspx.resx
and IDAutomationStreamingLinear.aspx.cs.
- Copy the appropriate Server Control DLL file to the ASP.NET project
directory. In this example, IDAutomation.linearservercontrol.dll
is copied.
- Add a reference to the IDAutomation Server Control in the project.
For example: Right-Click on References, choose Browse and select the
server control DLL.
- Add the IDAutomationStreamingLinear.aspx
file to the ASP.NET project by right-clicking the name of the project
in Solution Explorer and selecting Add Existing Item. The following
graphic illustrates the reference to the DLL and the image generating
web page aspx file in a solution.

- Rebuild the solution or project.
- To verify the project is working correctly, view the actual streaming
aspx page in the browser. Example: http://localhost/WebApplication1/IDAutomationStreamingLinear.aspx
- Choose the method that will update
properties of the barcode:
Dynamic IMG Tag Method:
- The following demonstrates how
to pass parameters to the
streaming barcode generator from a URL.
<img src="IDAutomationStreamingLinear.aspx?barcode=0123456789012&S=0&H=1.5"/>
IDAutomation provides examples of creating barcodes in this
way with
JavaScript
and
Crystal Reports.
Code-Behind Method:
- To implement code-behind using Visual
Studio .NET, reference the sample project included in the ZIP file
and the LinearStreamCS.csproj or
LinearStreamCS.csproj file. Add the
image tag referencing the image generating aspx page, which was
added to the project, to the aspx page that needs to display the
barcode image. Example: <img src="IDAutomationStreamingLinear.aspx"/>
The Page_Load event for the image generating .aspx page may
be changed to hard-code specific values for the image that is to
be displayed.
Back to Top
|