📄 multicolumntext.html
字号:
columnDefs</H3><PRE>private <A HREF="http://java.sun.com/j2se/1.4/docs/api/java/util/ArrayList.html?is-external=true" title="class or interface in java.util">ArrayList</A> <B>columnDefs</B></PRE><DL><DD>Array of <CODE>ColumnDef</CODE> objects used to define the columns<P><DL></DL></DL><HR><A NAME="simple"><!-- --></A><H3>simple</H3><PRE>private boolean <B>simple</B></PRE><DL><DD>true if all columns are simple (rectangular)<P><DL></DL></DL><HR><A NAME="currentColumn"><!-- --></A><H3>currentColumn</H3><PRE>private int <B>currentColumn</B></PRE><DL><DL></DL></DL><HR><A NAME="nextY"><!-- --></A><H3>nextY</H3><PRE>private float <B>nextY</B></PRE><DL><DL></DL></DL><HR><A NAME="columnsRightToLeft"><!-- --></A><H3>columnsRightToLeft</H3><PRE>private boolean <B>columnsRightToLeft</B></PRE><DL><DL></DL></DL><HR><A NAME="document"><!-- --></A><H3>document</H3><PRE>private <A HREF="../../../../com/lowagie/text/pdf/PdfDocument.html" title="class in com.lowagie.text.pdf">PdfDocument</A> <B>document</B></PRE><DL><DL></DL></DL><!-- ========= CONSTRUCTOR DETAIL ======== --><A NAME="constructor_detail"><!-- --></A><TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""><TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor"><TH ALIGN="left" COLSPAN="1"><FONT SIZE="+2"><B>Constructor Detail</B></FONT></TH></TR></TABLE><A NAME="MultiColumnText()"><!-- --></A><H3>MultiColumnText</H3><PRE>public <B>MultiColumnText</B>()</PRE><DL><DD>Default constructor. Sets height to <CODE>AUTOMATIC</CODE>. Columns will repeat on each page as necessary to accommodate content length.<P></DL><HR><A NAME="MultiColumnText(float)"><!-- --></A><H3>MultiColumnText</H3><PRE>public <B>MultiColumnText</B>(float height)</PRE><DL><DD>Construct a MultiColumnText container of the specified height. If height is <CODE>AUTOMATIC</CODE>, fill complete pages until done. If a specific height is used, it may span one or more pages.<P><DL><DT><B>Parameters:</B><DD><CODE>height</CODE> - </DL></DL><HR><A NAME="MultiColumnText(float, float)"><!-- --></A><H3>MultiColumnText</H3><PRE>public <B>MultiColumnText</B>(float top, float height)</PRE><DL><DD>Construct a MultiColumnText container of the specified height starting at the specified Y position.<P><DL><DT><B>Parameters:</B><DD><CODE>height</CODE> - <DD><CODE>top</CODE> - </DL></DL><!-- ============ METHOD DETAIL ========== --><A NAME="method_detail"><!-- --></A><TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""><TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor"><TH ALIGN="left" COLSPAN="1"><FONT SIZE="+2"><B>Method Detail</B></FONT></TH></TR></TABLE><A NAME="isOverflow()"><!-- --></A><H3>isOverflow</H3><PRE>public boolean <B>isOverflow</B>()</PRE><DL><DD>Indicates that all of the text did not fit in the specified height. Note that isOverflow will return false before the MultiColumnText object has been added to the document. It will always be false if the height is AUTOMATIC.<P><DD><DL></DL></DD><DD><DL><DT><B>Returns:</B><DD>true if there is still space left in the column</DL></DD></DL><HR><A NAME="useColumnParams(com.lowagie.text.pdf.ColumnText)"><!-- --></A><H3>useColumnParams</H3><PRE>public void <B>useColumnParams</B>(<A HREF="../../../../com/lowagie/text/pdf/ColumnText.html" title="class in com.lowagie.text.pdf">ColumnText</A> sourceColumn)</PRE><DL><DD>Copy the parameters from the specified ColumnText to use when rendering. Parameters like <CODE>setArabicOptions</CODE> must be set in this way.<P><DD><DL></DL></DD><DD><DL><DT><B>Parameters:</B><DD><CODE>sourceColumn</CODE> - </DL></DD></DL><HR><A NAME="addColumn(float[], float[])"><!-- --></A><H3>addColumn</H3><PRE>public void <B>addColumn</B>(float[] left, float[] right)</PRE><DL><DD>Add a new column. The parameters are limits for each column wall in the format of a sequence of points (x1,y1,x2,y2,...).<P><DD><DL></DL></DD><DD><DL><DT><B>Parameters:</B><DD><CODE>left</CODE> - limits for left column<DD><CODE>right</CODE> - limits for right column</DL></DD></DL><HR><A NAME="addSimpleColumn(float, float)"><!-- --></A><H3>addSimpleColumn</H3><PRE>public void <B>addSimpleColumn</B>(float left, float right)</PRE><DL><DD>Add a simple rectangular column with specified left and right x position boundaries.<P><DD><DL></DL></DD><DD><DL><DT><B>Parameters:</B><DD><CODE>left</CODE> - left boundary<DD><CODE>right</CODE> - right boundary</DL></DD></DL><HR><A NAME="addRegularColumns(float, float, float, int)"><!-- --></A><H3>addRegularColumns</H3><PRE>public void <B>addRegularColumns</B>(float left, float right, float gutterWidth, int numColumns)</PRE><DL><DD>Add the specified number of evenly spaced rectangular columns. Columns will be separated by the specified gutterWidth.<P><DD><DL></DL></DD><DD><DL><DT><B>Parameters:</B><DD><CODE>left</CODE> - left boundary of first column<DD><CODE>right</CODE> - right boundary of last column<DD><CODE>gutterWidth</CODE> - width of gutter spacing between columns<DD><CODE>numColumns</CODE> - number of columns to add</DL></DD></DL><HR><A NAME="addElement(com.lowagie.text.Element)"><!-- --></A><H3>addElement</H3><PRE>public void <B>addElement</B>(<A HREF="../../../../com/lowagie/text/Element.html" title="interface in com.lowagie.text">Element</A> element) throws <A HREF="../../../../com/lowagie/text/DocumentException.html" title="class in com.lowagie.text">DocumentException</A></PRE><DL><DD>Add an element to be rendered in a column. Note that you can only add a <CODE>Phrase</CODE> or a <CODE>Chunk</CODE> if the columns are not all simple. This is an underlying restriction in <A HREF="../../../../com/lowagie/text/pdf/ColumnText.html" title="class in com.lowagie.text.pdf"><CODE>ColumnText</CODE></A><P><DD><DL></DL></DD><DD><DL><DT><B>Parameters:</B><DD><CODE>element</CODE> - element to add<DT><B>Throws:</B><DD><CODE><A HREF="../../../../com/lowagie/text/DocumentException.html" title="class in com.lowagie.text">DocumentException</A></CODE> - if element can't be added</DL></DD></DL><HR><A NAME="write(com.lowagie.text.pdf.PdfContentByte, com.lowagie.text.pdf.PdfDocument, float)"><!-- --></A><H3>write</H3><PRE>public float <B>write</B>(<A HREF="../../../../com/lowagie/text/pdf/PdfContentByte.html" title="class in com.lowagie.text.pdf">PdfContentByte</A> canvas, <A HREF="../../../../com/lowagie/text/pdf/PdfDocument.html" title="class in com.lowagie.text.pdf">PdfDocument</A> document, float documentY) throws <A HREF="../../../../com/lowagie/text/DocumentException.html" title="class in com.lowagie.text">DocumentException</A></PRE><DL><DD>Write out the columns. After writing, use <A HREF="../../../../com/lowagie/text/pdf/MultiColumnText.html#isOverflow()"><CODE>isOverflow()</CODE></A> to see if all text was written.<P><DD><DL></DL></DD><DD><DL><DT><B>Parameters:</B><DD><CODE>canvas</CODE> - PdfContentByte to write with<DD><CODE>document</CODE> - document to write to (only used to get page limit info)<DD><CODE>documentY</CODE> - starting y position to begin writing at<DT><B>Returns:</B><DD>the current height (y position) after writing the columns<DT><B>Throws:</B><DD><CODE><A HREF="../../../../com/lowagie/text/DocumentException.html" title="class in com.lowagie.text">DocumentException</A></CODE> - on error</DL></DD></DL><HR><A NAME="newPage()"><!-- --></A><H3>newPage</H3><PRE>private void <B>newPage</B>() throws <A HREF="../../../../com/lowagie/text/DocumentException.html" title="class in com.lowagie.text">DocumentException</A></PRE><DL><DD><DL></DL></DD><DD><DL><DT><B>Throws:</B><DD><CODE><A HREF="../../../../com/lowagie/text/DocumentException.html" title="class in com.lowagie.text">DocumentException</A></CODE></DL></DD></DL><HR><A NAME="getHeight(float[], float[])"><!-- --></A><H3>getHeight</H3><PRE>private float <B>getHeight</B>(float[] left, float[] right)</PRE><DL><DD>Figure out the height of a column from the border extents<P><DD><DL></DL></DD><DD><DL><DT><B>Parameters:</B><DD><CODE>left</CODE> - left border<DD><CODE>right</CODE> - right border<DT><B>Returns:</B><DD>height</DL></DD></DL><HR><A NAME="process(com.lowagie.text.ElementListener)"><!-- --></A><H3>process</H3><PRE>public boolean <B>process</B>(<A HREF="../../../../com/lowagie/text/ElementListener.html" title="interface in com.lowagie.text">ElementListener</A> listener)</PRE><DL><DD>Processes the element by adding it to an <CODE>ElementListener</CODE>.<P><DD><DL><DT><B>Specified by:</B><DD><CODE><A HREF="../../../../com/lowagie/text/Element.html#process(com.lowagie.text.ElementListener)">process</A></CODE> in interface <CODE><A HREF="../../../../com/lowagie/text/Element.html" title="interface in com.lowagie.text">Element</A></CODE></DL></DD><DD><DL><DT><B>Parameters:</B><DD><CODE>listener</CODE> - an <CODE>ElementListener</CODE><DT><B>Returns:</B><DD><CODE>true</CODE> if the element was processed successfully</DL></DD></DL>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -