📄 document.html
字号:
</DL><HR><A NAME="removeDocListener(com.lowagie.text.DocListener)"><!-- --></A><H3>removeDocListener</H3><PRE>public void <B>removeDocListener</B>(<A HREF="../../../com/lowagie/text/DocListener.html" title="interface in com.lowagie.text">DocListener</A> listener)</PRE><DL><DD>Removes a <CODE>DocListener</CODE> from the <CODE>Document</CODE>.<P><DD><DL></DL></DD><DD><DL><DT><B>Parameters:</B><DD><CODE>listener</CODE> - the DocListener that has to be removed.</DL></DD></DL><HR><A NAME="add(com.lowagie.text.Element)"><!-- --></A><H3>add</H3><PRE>public boolean <B>add</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>Adds an <CODE>Element</CODE> to the <CODE>Document</CODE>.<P><DD><DL><DT><B>Specified by:</B><DD><CODE><A HREF="../../../com/lowagie/text/ElementListener.html#add(com.lowagie.text.Element)">add</A></CODE> in interface <CODE><A HREF="../../../com/lowagie/text/ElementListener.html" title="interface in com.lowagie.text">ElementListener</A></CODE></DL></DD><DD><DL><DT><B>Parameters:</B><DD><CODE>element</CODE> - the <CODE>Element</CODE> to add<DT><B>Returns:</B><DD><CODE>true</CODE> if the element was added, <CODE>false </CODE> if not<DT><B>Throws:</B><DD><CODE><A HREF="../../../com/lowagie/text/DocumentException.html" title="class in com.lowagie.text">DocumentException</A></CODE> - when a document isn't open yet, or has been closed</DL></DD></DL><HR><A NAME="open()"><!-- --></A><H3>open</H3><PRE>public void <B>open</B>()</PRE><DL><DD>Opens the document. <P> Once the document is opened, you can't write any Header- or Meta-information anymore. You have to open the document before you can begin to add content to the body of the document.<P><DD><DL><DT><B>Specified by:</B><DD><CODE><A HREF="../../../com/lowagie/text/DocListener.html#open()">open</A></CODE> in interface <CODE><A HREF="../../../com/lowagie/text/DocListener.html" title="interface in com.lowagie.text">DocListener</A></CODE></DL></DD><DD><DL></DL></DD></DL><HR><A NAME="setPageSize(com.lowagie.text.Rectangle)"><!-- --></A><H3>setPageSize</H3><PRE>public boolean <B>setPageSize</B>(<A HREF="../../../com/lowagie/text/Rectangle.html" title="class in com.lowagie.text">Rectangle</A> pageSize)</PRE><DL><DD>Sets the pagesize.<P><DD><DL><DT><B>Specified by:</B><DD><CODE><A HREF="../../../com/lowagie/text/DocListener.html#setPageSize(com.lowagie.text.Rectangle)">setPageSize</A></CODE> in interface <CODE><A HREF="../../../com/lowagie/text/DocListener.html" title="interface in com.lowagie.text">DocListener</A></CODE></DL></DD><DD><DL><DT><B>Parameters:</B><DD><CODE>pageSize</CODE> - the new pagesize<DT><B>Returns:</B><DD>a <CODE>boolean</CODE></DL></DD></DL><HR><A NAME="setMargins(float, float, float, float)"><!-- --></A><H3>setMargins</H3><PRE>public boolean <B>setMargins</B>(float marginLeft, float marginRight, float marginTop, float marginBottom)</PRE><DL><DD>Sets the margins.<P><DD><DL><DT><B>Specified by:</B><DD><CODE><A HREF="../../../com/lowagie/text/DocListener.html#setMargins(float, float, float, float)">setMargins</A></CODE> in interface <CODE><A HREF="../../../com/lowagie/text/DocListener.html" title="interface in com.lowagie.text">DocListener</A></CODE></DL></DD><DD><DL><DT><B>Parameters:</B><DD><CODE>marginLeft</CODE> - the margin on the left<DD><CODE>marginRight</CODE> - the margin on the right<DD><CODE>marginTop</CODE> - the margin on the top<DD><CODE>marginBottom</CODE> - the margin on the bottom<DT><B>Returns:</B><DD>a <CODE>boolean</CODE></DL></DD></DL><HR><A NAME="newPage()"><!-- --></A><H3>newPage</H3><PRE>public boolean <B>newPage</B>()</PRE><DL><DD>Signals that an new page has to be started.<P><DD><DL><DT><B>Specified by:</B><DD><CODE><A HREF="../../../com/lowagie/text/DocListener.html#newPage()">newPage</A></CODE> in interface <CODE><A HREF="../../../com/lowagie/text/DocListener.html" title="interface in com.lowagie.text">DocListener</A></CODE></DL></DD><DD><DL><DT><B>Returns:</B><DD><CODE>true</CODE> if the page was added, <CODE>false</CODE> if not.</DL></DD></DL><HR><A NAME="setHeader(com.lowagie.text.HeaderFooter)"><!-- --></A><H3>setHeader</H3><PRE>public void <B>setHeader</B>(<A HREF="../../../com/lowagie/text/HeaderFooter.html" title="class in com.lowagie.text">HeaderFooter</A> header)</PRE><DL><DD>Changes the header of this document.<P><DD><DL><DT><B>Specified by:</B><DD><CODE><A HREF="../../../com/lowagie/text/DocListener.html#setHeader(com.lowagie.text.HeaderFooter)">setHeader</A></CODE> in interface <CODE><A HREF="../../../com/lowagie/text/DocListener.html" title="interface in com.lowagie.text">DocListener</A></CODE></DL></DD><DD><DL><DT><B>Parameters:</B><DD><CODE>header</CODE> - the new header</DL></DD></DL><HR><A NAME="resetHeader()"><!-- --></A><H3>resetHeader</H3><PRE>public void <B>resetHeader</B>()</PRE><DL><DD>Resets the header of this document.<P><DD><DL><DT><B>Specified by:</B><DD><CODE><A HREF="../../../com/lowagie/text/DocListener.html#resetHeader()">resetHeader</A></CODE> in interface <CODE><A HREF="../../../com/lowagie/text/DocListener.html" title="interface in com.lowagie.text">DocListener</A></CODE></DL></DD><DD><DL></DL></DD></DL><HR><A NAME="setFooter(com.lowagie.text.HeaderFooter)"><!-- --></A><H3>setFooter</H3><PRE>public void <B>setFooter</B>(<A HREF="../../../com/lowagie/text/HeaderFooter.html" title="class in com.lowagie.text">HeaderFooter</A> footer)</PRE><DL><DD>Changes the footer of this document.<P><DD><DL><DT><B>Specified by:</B><DD><CODE><A HREF="../../../com/lowagie/text/DocListener.html#setFooter(com.lowagie.text.HeaderFooter)">setFooter</A></CODE> in interface <CODE><A HREF="../../../com/lowagie/text/DocListener.html" title="interface in com.lowagie.text">DocListener</A></CODE></DL></DD><DD><DL><DT><B>Parameters:</B><DD><CODE>footer</CODE> - the new footer</DL></DD></DL><HR><A NAME="resetFooter()"><!-- --></A><H3>resetFooter</H3><PRE>public void <B>resetFooter</B>()</PRE><DL><DD>Resets the footer of this document.<P><DD><DL><DT><B>Specified by:</B><DD><CODE><A HREF="../../../com/lowagie/text/DocListener.html#resetFooter()">resetFooter</A></CODE> in interface <CODE><A HREF="../../../com/lowagie/text/DocListener.html" title="interface in com.lowagie.text">DocListener</A></CODE></DL></DD><DD><DL></DL></DD></DL><HR><A NAME="resetPageCount()"><!-- --></A><H3>resetPageCount</H3><PRE>public void <B>resetPageCount</B>()</PRE><DL><DD>Sets the page number to 0.<P><DD><DL><DT><B>Specified by:</B><DD><CODE><A HREF="../../../com/lowagie/text/DocListener.html#resetPageCount()">resetPageCount</A></CODE> in interface <CODE><A HREF="../../../com/lowagie/text/DocListener.html" title="interface in com.lowagie.text">DocListener</A></CODE></DL></DD><DD><DL></DL></DD></DL><HR><A NAME="setPageCount(int)"><!-- --></A><H3>setPageCount</H3><PRE>public void <B>setPageCount</B>(int pageN)</PRE><DL><DD>Sets the page number.<P><DD><DL><DT><B>Specified by:</B><DD><CODE><A HREF="../../../com/lowagie/text/DocListener.html#setPageCount(int)">setPageCount</A></CODE> in interface <CODE><A HREF="../../../com/lowagie/text/DocListener.html" title="interface in com.lowagie.text">DocListener</A></CODE></DL></DD><DD><DL><DT><B>Parameters:</B><DD><CODE>pageN</CODE> - the new page number</DL></DD></DL><HR><A NAME="getPageNumber()"><!-- --></A><H3>getPageNumber</H3><PRE>public int <B>getPageNumber</B>()</PRE><DL><DD>Returns the current page number.<P><DD><DL></DL></DD><DD><DL><DT><B>Returns:</B><DD>the current page number</DL></DD></DL><HR><A NAME="close()"><!-- --></A><H3>close</H3><PRE>public void <B>close</B>()</PRE><DL><DD>Closes the document. <P> Once all the content has been written in the body, you have to close the body. After that nothing can be written to the body anymore.<P><DD><DL><DT><B>Specified by:</B><DD><CODE><A HREF="../../../com/lowagie/text/DocListener.html#close()">close</A></CODE> in interface <CODE><A HREF="../../../com/lowagie/text/DocListener.html" title="interface in com.lowagie.text">DocListener</A></CODE></DL></DD><DD><DL></DL></DD></DL><HR><A NAME="addHeader(java.lang.String, java.lang.String)"><!-- --></A><H3>addHeader</H3><PRE>public boolean <B>addHeader</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> name, <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> content)</PRE><DL><DD>Adds a user defined header to the document.<P><DD><DL></DL></DD><DD><DL><DT><B>Parameters:</B><DD><CODE>name</CODE> - the name of the header<DD><CODE>content</CODE> - the content of the header<DT><B>Returns:</B><DD><CODE>true</CODE> if successful, <CODE>false</CODE> otherwise</DL></DD></DL><HR><A NAME="addTitle(java.lang.String)"><!-- --></A><H3>addTitle</H3><PRE>public boolean <B>addTitle</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> title)</PRE><DL><DD>Adds the title to a Document.<P><DD><DL></DL></DD><DD><DL><DT><B>Parameters:</B><DD><CODE>title</CODE> - the title<DT><B>Returns:</B><DD><CODE>true</CODE> if successful, <CODE>false</CODE> otherwise</DL></DD></DL><HR><A NAME="addSubject(java.lang.String)"><!-- --></A><H3>addSubject</H3><PRE>public boolean <B>addSubject</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> subject)</PRE><DL><DD>Adds the subject to a Document.<P><DD><DL></DL></DD><DD><DL><DT><B>Parameters:</B><DD><CODE>subject</CODE> - the subject<DT><B>Returns:</B><DD><CODE>true</CODE> if successful, <CODE>false</CODE> otherwise</DL></DD></DL><HR><A NAME="addKeywords(java.lang.String)"><!-- --></A><H3>addKeywords</H3><PRE>public boolean <B>addKeywords</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> keywords)</PRE><DL><DD>Adds the keywords to a Document.<P><DD><DL></DL></DD><DD><DL><DT><B>Parameters:</B><DD><CODE>keywords</CODE> - adds the keywords to the document<DT><B>Returns:</B><DD><CODE>true</CODE> if successful, <CODE>false</CODE> otherwise</DL></DD></DL><HR><A NAME="addAuthor(java.lang.String)"><!-- --></A><H3>addAuthor</H3><PRE>public boolean <B>addAuthor</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> author)</PRE><DL><DD>Adds the author to a Document.<P><DD><DL></DL></DD><DD><DL><DT><B>Parameters:</B><DD><CODE>author</CODE> - the name of the author<DT><B>Returns:</B><DD><CODE>true</CODE> if successful, <CODE>false</CODE> otherwise</DL></DD></DL><HR><A NAME="addCreator(java.lang.String)"><!-- --></A><H3>addCreator</H3><PRE>public boolean <B>addCreator</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> creator)</PRE><DL><DD>Adds the creator to a Document.<P><DD><DL></DL></DD><DD><DL><DT><B>Parameters:</B><DD><CODE>creator</CODE> - the name of the creator<DT><B>Returns:</B><DD><CODE>true</CODE> if successful, <CODE>false</CODE> otherwise</DL></DD></DL><HR><A NAME="addProducer()"><!-- --></A><H3>addProducer</H3><PRE>public boolean <B>addProducer</B>()</PRE><DL><DD>Adds the producer to a Document.
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -