⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 barcodeaspx.htm

📁 非常实用的条形码制作工具
💻 HTM
字号:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN">
<HTML DIR="LTR"><HEAD>
<META HTTP-EQUIV="Content-Type" Content="text/html; charset=Windows-1252">
<TITLE>Barcode.aspx and BarcodeHandler.aspx</TITLE>
</HEAD>
<body topmargin="0">
<font size="-1">&nbsp;Barcode .Net Reference</font>
<H3>Barcode.aspx<br>BarcodeHandler.aspx</H3>
<P>Serves as a dynamic barcode image file and is used on a web server to dynamically generate barcode images.</P>
<H4>Syntax</H4>
<PRE>
<B>&ltimg src="</b><i>url_path</i><b>/Barcode.aspx"&gt
&ltimg src="</b><i>url_path</i><b>/Barcode.aspx?</b><i>param1</i><b>=</b><i>value1</i><b>&amp;</b><i>param2</i><b>=</b><i>value2</i>..."&gt
<b>&ltimg src="BarcodeHandler.aspx"&gt
&ltimg src="BarcodeHandler.aspx?</b><i>param1</i><b>=</b><i>value1</i><b>&amp;</b><i>param2</i><b>=</b><i>value2</i>..."&gt
</B></PRE>
where <i>url_path</i> is a URL path that specifies the location of the <b>Barcode.aspx</b> file
and <i>param</i>i, all optional, may be any of the following (case insensitive),
<DL><DT><I>BarcodeType</I></DT>
<DD>Specifies the barcode type for the barcode image to be generated,
<table border="1" cellspacing="0">
<tr><td align="center" bgcolor="#cccccc">Value</td><td align="center" bgcolor="#cccccc">Meaning</td></tr>
<tr><td><tt>EAN13</tt></td><td>EAN-13 barcode.</td></tr>
<tr><td><tt>EAN8</tt></td><td>EAN-8 barcode.</td></tr>
<tr><td><tt>UPCA</tt></td><td>UPC-A barcode.</td></tr>
<tr><td><tt>CODE39CHECK</tt></td><td>Code 39 Check barcode.</td></tr>
<tr><td><tt>CODABAR</tt></td><td>Codabar barcode.</td></tr>
<tr><td><tt><b>CODE39</b></tt></td><td>(Default) Code 39 barcode.</td></tr>
<tr><td><tt>C2OF5</tt></td><td>Code 2 of 5 barcode.</td></tr>
<tr><td><tt>INTERLEAVED2OF5</tt></td><td>Interleaved 2 of 5 barcode.</td></tr>
<tr><td><tt>UPCE</tt></td><td>UPC-E barcode.</td></tr>
<tr><td><tt>EAN13_2</tt></td><td>EAN-13 + 2 barcode.</td></tr>
<tr><td><tt>EAN13_5</tt></td><td>EAN-13 + 5 barcode.</td></tr>
<tr><td><tt>EAN8_2</tt></td><td>EAN-8 + 2 barcode.</td></tr>
<tr><td><tt>EAN8_5</tt></td><td>EAN-8 + 5 barcode.</td></tr>
<tr><td><tt>UPCA_2</tt></td><td>UPC-A + 2 barcode.</td></tr>
<tr><td><tt>UPCA_5</tt></td><td>UPC-A + 5 barcode.</td></tr>
<tr><td><tt>UPCE_2</tt></td><td>UPC-E + 2 barcode.</td></tr>
<tr><td><tt>UPCE_5</tt></td><td>UPC-E + 5 barcode.</td></tr>
<tr><td><tt>EAN128A</tt></td><td>EAN-128 A barcode.</td></tr>
<tr><td><tt>EAN128B</tt></td><td>EAN-128 B barcode.</td></tr>
<tr><td><tt>EAN128C</tt></td><td>EAN-128 C barcode.</td></tr>
<tr><td><tt>CODE93</tt></td><td>Code 93 barcode.</td></tr>
<tr><td><tt>POSTNET</tt></td><td>POSTNET barcode.</td></tr>
<tr><td><tt>CODE128A</tt></td><td>Code-128 A barcode.</td></tr>
<tr><td><tt>CODE128B</tt></td><td>Code-128 B barcode.</td></tr>
<tr><td><tt>CODE128C</tt></td><td>Code-128 C barcode.</td></tr>
</table></dd>
<DT><I>Data</I></DT>
<DD>Specifies the barcode data. Note that some characters may need to be URL-encoded as dictated by the HTTP 
specification. For example, you would use "+" for space " ".
<p>If the barcode type supports check characters, it's not necessary
to include them in the data. 
<p>
If your barcode data contains a native character with no ASCII equivalent, 
you need to use the character whose (ANSI Western/Unicode) code is that of the native character plus 128.
For example, in the Code-128 case, the <i>FNC 1</i> character (native code: 102) would be represented
by the character whose code is 102+128 = 230 (or 0xE6 in hex). To use such a character in a URL,
you need to URL encode it; i.e., you would need to use 0xU00E6 for <i>FNC 1</i>.
<DT><I>AddOnData</I></DT>
<DD>Specifies the add-on barcode data if the barcode type has an add-on barcode.</dd>
<DT><I>ImageFormat</I></DT>
<DD>Specifies the image format the barcode is to be generated in:
<table border="1" cellspacing="0">
<tr><td align="center" bgcolor="#cccccc">Value</td><td align="center" bgcolor="#cccccc">Meaning</td></tr>
<tr><td><tt><b>GIF</b></tt></td><td>(Default) Gif format.</td></tr>
<tr><td><tt>JPEG</tt></td><td>JPeg format.</td></tr>
<tr><td><tt>PNG</tt></td><td>Png format.</td></tr>
<tr><td><tt>TIFF</tt></td><td>Tiff format.</td></tr>
<tr><td><tt>BMP</tt></td><td>Windows BMP format.</td></tr>
</table></DD>
<DT><I>BarWidth</I></DT>
<DD>Specifies the width of the narrowest barcode bar in pixels; the default is 1. If you specify <i>BarWidth</i>,
you should not specify <i>Width</i> at the same time.</dd>
<DT><I>Width</I></DT>
<DD>Specifies the desired width of the barcode in pixels; depending on the <i>orientation</i>,
this may either be the actual <i>image </i>width or height. An alternative way of specifying
the barcode width is to use the <i>BarWidth</i> parameter.</dd>
<DT><I>Height</I></DT>
<DD>Specifies the desired height of the barcode in pixels; depending on the <i>orientation</i>,
this may either be the actual <i>image </i>height or width.</dd>
<DT><I>Orientation</I></DT>
<DD>Specifies the orientation of the barcode image:
<table border="1" cellspacing="0">
<tr><td align="center" bgcolor="#cccccc">Value</td><td align="center" bgcolor="#cccccc">Meaning</td></tr>
<tr><td><tt><b>BottomFacing</b></tt></td><td>(Default) Bottom facing.</td></tr>
<tr><td><tt>RightFacing</tt></td><td>Right facing.</td></tr>
<tr><td><tt>TopFacing</tt></td><td>Top facing.</td></tr>
<tr><td><tt>LeftFacing</tt></td><td>Left facing.</td></tr>
</table></DD>
<DT><I>Transparent</I></DT>
<DD>Specifies the barcode image generated should be transparent, if 
the image format used supports transparency:
<table border="1" cellspacing="0">
<tr><td align="center" bgcolor="#cccccc">Value</td><td align="center" bgcolor="#cccccc">Meaning</td></tr>
<tr><td><tt>True</tt></td><td>Image is transparent.</td></tr>
<tr><td><tt><b>False</b></tt></td><td>(Default) Image is not transparent.</td></tr>
</table></DD>
<DT><I>Caption</I></DT>
<DD>Specifies the barcode caption. This will be used to override the default caption
that is the barcode data with any native characters removed.</DD>
<DT><I>AddOnCaption</I></DT>
<DD>Specifies the add-on barcode caption. This will be used to override the default add-on caption
that is the add-on barcode data with any native characters removed.</dd>
<DT><I>FontName</I></DT>
<DD>Specifies the name of the font used to draw the barcode caption(s), e.g., <tt>Times New Roman</tt>. The font needs to exist on your server system. Default: <tt>Arial</tt>.</dd>
<DT><I>FontSize</I></DT>
<DD>Specifies the size of the font in points used to draw the barcode caption(s), e.g., <tt>10.5</tt>. Default: <tt>9</tt>.</dd>
<DT><I>FontStyle</I></DT>
<DD>Specifies the style of the font used to draw the barcode caption(s):
<table border="1" cellspacing="0">
<tr><td align="center" bgcolor="#cccccc">Value</td><td align="center" bgcolor="#cccccc">Meaning</td></tr>
<tr><td><tt>Bold</tt></td><td>Bold text.</td></tr>
<tr><td><tt>Italic</tt></td><td>Italic text.</td></tr>
<tr><td><tt><b>Regular</b></tt></td><td>(Default) Normal text.</td></tr>
<tr><td><tt>Strikeout</tt></td><td>Text with a line through the middle.</td></tr>
<tr><td><tt>Underline</tt></td><td>Underlined text.</td></tr>
</table></DD>
<DT><I>TextPosition</I></DT>
<DD>Specifies the position and visibility of the barcode caption:
<table border="1" cellspacing="0">
<tr><td align="center" bgcolor="#cccccc">Value</td><td align="center" bgcolor="#cccccc">Meaning</td></tr>
<tr><td><tt>Above</tt></td><td>Caption above the barcode.</td></tr>
<tr><td><tt><b>Below</b></tt></td><td>(Default) Caption below the barcode.</td></tr>
<tr><td><tt>NotShown</tt></td><td>Caption hidden and no space reserved for it.</td></tr>
</table></DD>
<DT><I>AddOnTextPosition</I></DT>
<DD>Specifies the position and visibility of the add-on barcode caption:
<table border="1" cellspacing="0">
<tr><td align="center" bgcolor="#cccccc">Value</td><td align="center" bgcolor="#cccccc">Meaning</td></tr>
<tr><td><tt><b>Above</b></tt></td><td>(Default) Add-on caption above the barcode.</td></tr>
<tr><td><tt>Below</tt></td><td>Add-on caption below the barcode.</td></tr>
<tr><td><tt>NotShown</tt></td><td>Add-on caption hidden and no space reserved for it.</td></tr>
</table></DD>
<DT><I>UniBarHeight</I></DT>
<DD>Specifies whether to use a single bar length to draw both the long and short bars if applicable:
<table border="1" cellspacing="0">
<tr><td align="center" bgcolor="#cccccc">Value</td><td align="center" bgcolor="#cccccc">Meaning</td></tr>
<tr><td><tt>True</tt></td><td>Use the same length for both long and short bars.</td></tr>
<tr><td><tt><b>False</b></tt></td><td>(Default) Use separate lengths for long and short bars.</td></tr>
</table></DD>
<DT><I>StretchText</I></DT>
<DD>Specifies whether to stretch the barcode caption to fit the full width of the barcode:
<table border="1" cellspacing="0">
<tr><td align="center" bgcolor="#cccccc">Value</td><td align="center" bgcolor="#cccccc">Meaning</td></tr>
<tr><td><tt><b>True</b></tt></td><td>(Default) Stretch the barcode caption.</td></tr>
<tr><td><tt>False</tt></td><td>Do not stretch the barcode caption.</td></tr>
</table></DD>
<DT><I>ShowCode39StartStop</I></DT>
<DD>Specifies whether to use a "*" to start and end the caption of a Code 39 barcode:
<table border="1" cellspacing="0">
<tr><td align="center" bgcolor="#cccccc">Value</td><td align="center" bgcolor="#cccccc">Meaning</td></tr>
<tr><td><tt><b>True</b></tt></td><td>(Default) Use "*" to start and end Code 39 barcode caption.</td></tr>
<tr><td><tt>False</tt></td><td>Do not use "*" to start and end Code 39 barcode caption.</td></tr>
</table></DD>
<DT><I>RetainAspectRatio</I></DT>
<DD>Specifies whether to adjust proportionally the barcode height when the barcode width is changed due to pixel alignment:
<table border="1" cellspacing="0">
<tr><td align="center" bgcolor="#cccccc">Value</td><td align="center" bgcolor="#cccccc">Meaning</td></tr>
<tr><td><tt>True</tt></td><td>Adjust height proportionally on width change.</td></tr>
<tr><td><tt><b>False</b></tt></td><td>(Default) Do not adjust height on width change.</td></tr>
</table></DD>
<DT><I>UpcSmallFont</I></DT>
<DD>Specifies whether to use a smaller font to draw the first and last characters of a UPC barcode caption:
<table border="1" cellspacing="0">
<tr><td align="center" bgcolor="#cccccc">Value</td><td align="center" bgcolor="#cccccc">Meaning</td></tr>
<tr><td><tt><b>True</b></tt></td><td>(Default) Use a smaller font to draw the first and last characters of a UPC barcode caption.</td></tr>
<tr><td><tt>False</tt></td><td>Do not use a smaller font to draw the first and last characters of a UPC barcode caption.</td></tr>
</table></DD>
<DT><I>BackColor</I></DT>
<DD>Specifies the background color of the barcode image. This may be a known color name like <tt>white</tt>, <tt>blue</tt>, etc., or a color value in the <tt>#rrggbb</tt> format, e.g., <nobr><tt>%2300ff00</tt></nobr> for green; note that in a URL, # has to be URL-encoded as <tt>%23</tt>. Default: <tt><b>white</b></tt>.
<DT><I>ForeColor</I></DT>
<DD>Specifies the color of the barcode bars and caption(s). This may be a known color name like <tt>black</tt>, <tt>red</tt>, etc., or a color value in the <tt>#rrggbb</tt> format, e.g., <nobr><tt>%23ff0000</tt></nobr> for red; note that in a URL, # has to be URL-encoded as <tt>%23</tt>. Default: <tt><b>black</b></tt>.
<DT><I>InvalidDataAction</I></DT>
<DD>Specifies the action to take when the barcode data is invalid:
<table border="1" cellspacing="0">
<tr><td align="center" bgcolor="#cccccc">Value</td><td align="center" bgcolor="#cccccc">Meaning</td></tr>
<tr><td><tt>DisplayNone</tt></td><td>Draw nothing.</td></tr>
<tr><td><tt>DisplayTextOnly</tt></td><td>Draw only the (invalid) barcode data.</td></tr>
<tr><td><tt>DisplayDefaultBarcode</tt></td><td>Draw a barcode image corresponding to the default data "000000".</td></tr>
<tr><td><tt><b>DisplayInvalid</b></tt></td><td>(Default) Draw the text "Invalid Data".</td></tr>
</table></DD>
<!--
<DT><I>RaiseBottomTextB</I></DT>
<DD>...</dd>
<DT><I>LowerTopTextB</I></DT>
<DD>...</dd>
-->
</DL>
<H4>Remarks</H4>
<P><b>Barcode.aspx</b> is an actual file; you can put it anywhere in the directory tree of your web application. To use it in an HTML <tt>&lt;img&gt;</tt> element, you may need to specify 
the necessary directory path (i.e., <i>url_path</i> in the <b>Syntax</b> section above). 
<p><b>BarcodeHandler.aspx</b> is <i>not</i> an actual file. To use it, you do not need to specify
any directory path; the file name alone will do. However, you do need to add the following entry,<pre>
&lt;httpHandlers&gt;
&nbsp;&nbsp;&lt;add verb="GET" path="BarcodeHandler.aspx" type="Bokai.Barcodes.BarcodeHandler, Bokai.Barcodes" /&gt;</tt>
&lt;/httpHandlers&gt;
</pre>in your application's Web.config file, which is located in your application's virtual directory (or <tt>C:\Inetpub\wwwroot\</tt> if you don't have a specific application).
<HR>
<font size="-1">&copy; 2002 Bokai Corporation. All rights reserved.</font>
</BODY>
</HTML>

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -