📄 barcodedatamatrix.html
字号:
<DD><DL></DL></DD></DL><HR><A NAME="generate(java.lang.String)"><!-- --></A><H3>generate</H3><PRE>public int <B>generate</B>(<A HREF="http://java.sun.com/j2se/1.4/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</A> text) throws <A HREF="http://java.sun.com/j2se/1.4/docs/api/java/io/UnsupportedEncodingException.html?is-external=true" title="class or interface in java.io">UnsupportedEncodingException</A></PRE><DL><DD>Creates a barcode. The <CODE>String</CODE> is interpreted with the ISO-8859-1 encoding<P><DD><DL><DT><B>Parameters:</B><DD><CODE>text</CODE> - the text<DT><B>Returns:</B><DD>the status of the generation. It can be one of this values: <p> <CODE>DM_NO_ERROR</CODE> - no error.<br> <CODE>DM_ERROR_TEXT_TOO_BIG</CODE> - the text is too big for the symbology capabilities.<br> <CODE>DM_ERROR_INVALID_SQUARE</CODE> - the dimensions given for the symbol are illegal.<br> <CODE>DM_ERROR_EXTENSION</CODE> - an error was while parsing an extension.<DT><B>Throws:</B><DD><CODE><A HREF="http://java.sun.com/j2se/1.4/docs/api/java/io/UnsupportedEncodingException.html?is-external=true" title="class or interface in java.io">UnsupportedEncodingException</A></CODE> - on error</DL></DD></DL><HR><A NAME="generate(byte[], int, int)"><!-- --></A><H3>generate</H3><PRE>public int <B>generate</B>(byte[] text, int textOffset, int textSize)</PRE><DL><DD>Creates a barcode.<P><DD><DL><DT><B>Parameters:</B><DD><CODE>text</CODE> - the text<DD><CODE>textOffset</CODE> - the offset to the start of the text<DD><CODE>textSize</CODE> - the text size<DT><B>Returns:</B><DD>the status of the generation. It can be one of this values: <p> <CODE>DM_NO_ERROR</CODE> - no error.<br> <CODE>DM_ERROR_TEXT_TOO_BIG</CODE> - the text is too big for the symbology capabilities.<br> <CODE>DM_ERROR_INVALID_SQUARE</CODE> - the dimensions given for the symbol are illegal.<br> <CODE>DM_ERROR_EXTENSION</CODE> - an error was while parsing an extension.</DL></DD></DL><HR><A NAME="createImage()"><!-- --></A><H3>createImage</H3><PRE>public <A HREF="../../../../com/lowagie/text/Image.html" title="class in com.lowagie.text">Image</A> <B>createImage</B>() throws <A HREF="../../../../com/lowagie/text/BadElementException.html" title="class in com.lowagie.text">BadElementException</A></PRE><DL><DD>Gets an <CODE>Image</CODE> with the barcode. A successful call to the method <CODE>generate()</CODE> before calling this method is required.<P><DD><DL><DT><B>Returns:</B><DD>the barcode <CODE>Image</CODE><DT><B>Throws:</B><DD><CODE><A HREF="../../../../com/lowagie/text/BadElementException.html" title="class in com.lowagie.text">BadElementException</A></CODE> - on error</DL></DD></DL><HR><A NAME="createAwtImage(java.awt.Color, java.awt.Color)"><!-- --></A><H3>createAwtImage</H3><PRE>public <A HREF="http://java.sun.com/j2se/1.4/docs/api/java/awt/Image.html?is-external=true" title="class or interface in java.awt">Image</A> <B>createAwtImage</B>(<A HREF="http://java.sun.com/j2se/1.4/docs/api/java/awt/Color.html?is-external=true" title="class or interface in java.awt">Color</A> foreground, <A HREF="http://java.sun.com/j2se/1.4/docs/api/java/awt/Color.html?is-external=true" title="class or interface in java.awt">Color</A> background)</PRE><DL><DD>Creates a <CODE>java.awt.Image</CODE>. A successful call to the method <CODE>generate()</CODE> before calling this method is required.<P><DD><DL><DT><B>Parameters:</B><DD><CODE>foreground</CODE> - the color of the bars<DD><CODE>background</CODE> - the color of the background<DT><B>Returns:</B><DD>the image</DL></DD></DL><HR><A NAME="getImage()"><!-- --></A><H3>getImage</H3><PRE>public byte[] <B>getImage</B>()</PRE><DL><DD>Gets the generated image. The image is represented as a stream of bytes, each byte representing 8 pixels, 0 for white and 1 for black, with the high-order bit of each byte first. Each row is aligned at byte boundaries. The dimensions of the image are defined by height and width plus 2 * ws.<P><DD><DL><DT><B>Returns:</B><DD>the generated image</DL></DD></DL><HR><A NAME="getHeight()"><!-- --></A><H3>getHeight</H3><PRE>public int <B>getHeight</B>()</PRE><DL><DD>Gets the height of the barcode. Will contain the real height used after a successful call to <CODE>generate()</CODE>. This height doesn't include the whitespace border, if any.<P><DD><DL><DT><B>Returns:</B><DD>the height of the barcode</DL></DD></DL><HR><A NAME="setHeight(int)"><!-- --></A><H3>setHeight</H3><PRE>public void <B>setHeight</B>(int height)</PRE><DL><DD>Sets the height of the barcode. If the height is zero it will be calculated. This height doesn't include the whitespace border, if any. <p> The allowed dimensions are (height, width):<p> 10, 10<br> 12, 12<br> 8, 18<br> 14, 14<br> 8, 32<br> 16, 16<br> 12, 26<br> 18, 18<br> 20, 20<br> 12, 36<br> 22, 22<br> 16, 36<br> 24, 24<br> 26, 26<br> 16, 48<br> 32, 32<br> 36, 36<br> 40, 40<br> 44, 44<br> 48, 48<br> 52, 52<br> 64, 64<br> 72, 72<br> 80, 80<br> 88, 88<br> 96, 96<br> 104, 104<br> 120, 120<br> 132, 132<br> 144, 144<br><P><DD><DL><DT><B>Parameters:</B><DD><CODE>height</CODE> - the height of the barcode</DL></DD></DL><HR><A NAME="getWidth()"><!-- --></A><H3>getWidth</H3><PRE>public int <B>getWidth</B>()</PRE><DL><DD>Gets the width of the barcode. Will contain the real width used after a successful call to <CODE>generate()</CODE>. This width doesn't include the whitespace border, if any.<P><DD><DL><DT><B>Returns:</B><DD>the width of the barcode</DL></DD></DL><HR><A NAME="setWidth(int)"><!-- --></A><H3>setWidth</H3><PRE>public void <B>setWidth</B>(int width)</PRE><DL><DD>Sets the width of the barcode. If the width is zero it will be calculated. This width doesn't include the whitespace border, if any. <p> The allowed dimensions are (height, width):<p> 10, 10<br> 12, 12<br> 8, 18<br> 14, 14<br> 8, 32<br> 16, 16<br> 12, 26<br> 18, 18<br> 20, 20<br> 12, 36<br> 22, 22<br> 16, 36<br> 24, 24<br> 26, 26<br> 16, 48<br> 32, 32<br> 36, 36<br> 40, 40<br> 44, 44<br> 48, 48<br> 52, 52<br> 64, 64<br> 72, 72<br> 80, 80<br> 88, 88<br> 96, 96<br> 104, 104<br> 120, 120<br> 132, 132<br> 144, 144<br><P><DD><DL><DT><B>Parameters:</B><DD><CODE>width</CODE> - the width of the barcode</DL></DD></DL><HR><A NAME="getWs()"><!-- --></A><H3>getWs</H3><PRE>public int <B>getWs</B>()</PRE><DL><DD>Gets the whitespace border around the barcode.<P><DD><DL><DT><B>Returns:</B><DD>the whitespace border around the barcode</DL></DD></DL><HR><A NAME="setWs(int)"><!-- --></A><H3>setWs</H3><PRE>public void <B>setWs</B>(int ws)</PRE><DL><DD>Sets the whitespace border around the barcode.<P><DD><DL><DT><B>Parameters:</B><DD><CODE>ws</CODE> - the whitespace border around the barcode</DL></DD></DL><HR><A NAME="getOptions()"><!-- --></A><H3>getOptions</H3><PRE>public int <B>getOptions</B>()</PRE><DL><DD>Gets the barcode options.<P><DD><DL><DT><B>Returns:</B><DD>the barcode options</DL></DD></DL><HR><A NAME="setOptions(int)"><!-- --></A><H3>setOptions</H3><PRE>public void <B>setOptions</B>(int options)</PRE><DL><DD>Sets the options for the barcode generation. The options can be:<p> One of:<br> <CODE>DM_AUTO</CODE> - the best encodation will be used<br> <CODE>DM_ASCII</CODE> - ASCII encodation<br> <CODE>DM_C40</CODE> - C40 encodation<br> <CODE>DM_TEXT</CODE> - TEXT encodation<br> <CODE>DM_B256</CODE> - binary encodation<br> <CODE>DM_X21</CODE> - X21 encodation<br> <CODE>DM_EDIFACT</CODE> - EDIFACT encodation<br> <CODE>DM_RAW</CODE> - no encodation. The bytes provided are already encoded and will be added directly to the barcode, using padding if needed. It assumes that the encodation state is left at ASCII after the last byte.<br> <p> One of:<br> <CODE>DM_EXTENSION</CODE> - allows extensions to be embedded at the start of the text:<p> exxxxxx - ECI number xxxxxx<br> m5 - macro 5<br> m6 - macro 6<br> f - FNC1<br> saabbccccc - Structured Append, aa symbol position (1-16), bb total number of symbols (2-16), ccccc file identification (0-64515)<br> p - Reader programming<br> . - extension terminator<p> Example for a structured append, symbol 2 of 6, with FNC1 and ECI 000005. The actual text is "Hello".<p> s020600075fe000005.Hello<p> One of:<br> <CODE>DM_TEST</CODE> - doesn't generate the image but returns all the other information.<P><DD><DL><DT><B>Parameters:</B><DD><CODE>options</CODE> - the barcode options</DL></DD></DL><!-- ========= END OF CLASS DATA ========= --><HR><!-- ======= START OF BOTTOM NAVBAR ====== --><A NAME="navbar_bottom"><!-- --></A><A HREF="#skip-navbar_bottom" title="Skip navigation links"></A><TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0" SUMMARY=""><TR><TD COLSPAN=2 BGCOLOR="#EEEEFF" CLASS="NavBarCell1"><A NAME="navbar_bottom_firstrow"><!-- --></A><TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3" SUMMARY=""> <TR ALIGN="center" VALIGN="top"> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../overview-summary.html"><FONT CLASS="NavBarFont1"><B>Overview</B></FONT></A> </TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-summary.html"><FONT CLASS="NavBarFont1"><B>Package</B></FONT></A> </TD> <TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> <FONT CLASS="NavBarFont1Rev"><B>Class</B></FONT> </TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A> </TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated</B></FONT></A> </TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../index-all.html"><FONT CLASS="NavBarFont1"><B>Index</B></FONT></A> </TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A> </TD> </TR></TABLE></TD><TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM>Hosted by <a href="http://www.hostbasket.com/">Hostbasket</a></EM></TD></TR><TR><TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> <A HREF="../../../../com/lowagie/text/pdf/BarcodeCodabar.html" title="class in com.lowagie.text.pdf"><B>PREV CLASS</B></A> <A HREF="../../../../com/lowagie/text/pdf/BarcodeDatamatrix.DmParams.html" title="class in com.lowagie.text.pdf"><B>NEXT CLASS</B></A></FONT></TD><TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> <A HREF="../../../../index.html?com/lowagie/text/pdf/BarcodeDatamatrix.html" target="_top"><B>FRAMES</B></A> <A HREF="BarcodeDatamatrix.html" target="_top"><B>NO FRAMES</B></A> <SCRIPT type="text/javascript"> <!-- if(window==top) { document.writeln('<A HREF="../../../../allclasses-noframe.html"><B>All Classes</B></A>'); } //--></SCRIPT><NOSCRIPT> <A HREF="../../../../allclasses-noframe.html"><B>All Classes</B></A></NOSCRIPT></FONT></TD></TR><TR><TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2"> SUMMARY: <A HREF="#nested_class_summary">NESTED</A> | <A HREF="#field_summary">FIELD</A> | <A HREF="#constructor_summary">CONSTR</A> | <A HREF="#method_summary">METHOD</A></FONT></TD><TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">DETAIL: <A HREF="#field_detail">FIELD</A> | <A HREF="#constructor_detail">CONSTR</A> | <A HREF="#method_detail">METHOD</A></FONT></TD></TR></TABLE><A NAME="skip-navbar_bottom"></A><!-- ======== END OF BOTTOM NAVBAR ======= --><HR></BODY></HTML>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -