📄 pdfstamper.html
字号:
<P><DD><DL></DL></DD><DD><DL><DT><B>Returns:</B><DD>the map or <CODE>null</CODE></DL></DD></DL><HR><A NAME="setMoreInfo(java.util.HashMap)"><!-- --></A><H3>setMoreInfo</H3><PRE>public void <B>setMoreInfo</B>(<A HREF="http://java.sun.com/j2se/1.4/docs/api/java/util/HashMap.html?is-external=true" title="class or interface in java.util">HashMap</A> moreInfo)</PRE><DL><DD>An optional <CODE>String</CODE> map to add or change values in the info dictionary. Entries with <CODE>null</CODE> values delete the key in the original info dictionary<P><DD><DL></DL></DD><DD><DL><DT><B>Parameters:</B><DD><CODE>moreInfo</CODE> - additional entries to the info dictionary</DL></DD></DL><HR><A NAME="replacePage(com.lowagie.text.pdf.PdfReader, int, int)"><!-- --></A><H3>replacePage</H3><PRE>public void <B>replacePage</B>(<A HREF="../../../../com/lowagie/text/pdf/PdfReader.html" title="class in com.lowagie.text.pdf">PdfReader</A> r, int pageImported, int pageReplaced)</PRE><DL><DD>Replaces a page from this document with a page from other document. Only the content is replaced not the fields and annotations. This method must be called before getOverContent() or getUndercontent() are called for the same page.<P><DD><DL></DL></DD><DD><DL><DT><B>Parameters:</B><DD><CODE>r</CODE> - the <CODE>PdfReader</CODE> from where the new page will be imported<DD><CODE>pageImported</CODE> - the page number of the imported page<DD><CODE>pageReplaced</CODE> - the page to replace in this document<DT><B>Since:</B></DT> <DD>iText 2.1.1</DD></DL></DD></DL><HR><A NAME="insertPage(int, com.lowagie.text.Rectangle)"><!-- --></A><H3>insertPage</H3><PRE>public void <B>insertPage</B>(int pageNumber, <A HREF="../../../../com/lowagie/text/Rectangle.html" title="class in com.lowagie.text">Rectangle</A> mediabox)</PRE><DL><DD>Inserts a blank page. All the pages above and including <CODE>pageNumber</CODE> will be shifted up. If <CODE>pageNumber</CODE> is bigger than the total number of pages the new page will be the last one.<P><DD><DL></DL></DD><DD><DL><DT><B>Parameters:</B><DD><CODE>pageNumber</CODE> - the page number position where the new page will be inserted<DD><CODE>mediabox</CODE> - the size of the new page</DL></DD></DL><HR><A NAME="getSignatureAppearance()"><!-- --></A><H3>getSignatureAppearance</H3><PRE>public <A HREF="../../../../com/lowagie/text/pdf/PdfSignatureAppearance.html" title="class in com.lowagie.text.pdf">PdfSignatureAppearance</A> <B>getSignatureAppearance</B>()</PRE><DL><DD>Gets the signing instance. The appearances and other parameters can the be set.<P><DD><DL></DL></DD><DD><DL><DT><B>Returns:</B><DD>the signing instance</DL></DD></DL><HR><A NAME="close()"><!-- --></A><H3>close</H3><PRE>public void <B>close</B>() throws <A HREF="../../../../com/lowagie/text/DocumentException.html" title="class in com.lowagie.text">DocumentException</A>, <A HREF="http://java.sun.com/j2se/1.4/docs/api/java/io/IOException.html?is-external=true" title="class or interface in java.io">IOException</A></PRE><DL><DD>Closes the document. No more content can be written after the document is closed. <p> If closing a signed document with an external signature the closing must be done in the <CODE>PdfSignatureAppearance</CODE> instance.<P><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> - on error<DD><CODE><A HREF="http://java.sun.com/j2se/1.4/docs/api/java/io/IOException.html?is-external=true" title="class or interface in java.io">IOException</A></CODE> - on error</DL></DD></DL><HR><A NAME="getUnderContent(int)"><!-- --></A><H3>getUnderContent</H3><PRE>public <A HREF="../../../../com/lowagie/text/pdf/PdfContentByte.html" title="class in com.lowagie.text.pdf">PdfContentByte</A> <B>getUnderContent</B>(int pageNum)</PRE><DL><DD>Gets a <CODE>PdfContentByte</CODE> to write under the page of the original document.<P><DD><DL></DL></DD><DD><DL><DT><B>Parameters:</B><DD><CODE>pageNum</CODE> - the page number where the extra content is written<DT><B>Returns:</B><DD>a <CODE>PdfContentByte</CODE> to write under the page of the original document</DL></DD></DL><HR><A NAME="getOverContent(int)"><!-- --></A><H3>getOverContent</H3><PRE>public <A HREF="../../../../com/lowagie/text/pdf/PdfContentByte.html" title="class in com.lowagie.text.pdf">PdfContentByte</A> <B>getOverContent</B>(int pageNum)</PRE><DL><DD>Gets a <CODE>PdfContentByte</CODE> to write over the page of the original document.<P><DD><DL></DL></DD><DD><DL><DT><B>Parameters:</B><DD><CODE>pageNum</CODE> - the page number where the extra content is written<DT><B>Returns:</B><DD>a <CODE>PdfContentByte</CODE> to write over the page of the original document</DL></DD></DL><HR><A NAME="isRotateContents()"><!-- --></A><H3>isRotateContents</H3><PRE>public boolean <B>isRotateContents</B>()</PRE><DL><DD>Checks if the content is automatically adjusted to compensate the original page rotation.<P><DD><DL></DL></DD><DD><DL><DT><B>Returns:</B><DD>the auto-rotation status</DL></DD></DL><HR><A NAME="setRotateContents(boolean)"><!-- --></A><H3>setRotateContents</H3><PRE>public void <B>setRotateContents</B>(boolean rotateContents)</PRE><DL><DD>Flags the content to be automatically adjusted to compensate the original page rotation. The default is <CODE>true</CODE>.<P><DD><DL></DL></DD><DD><DL><DT><B>Parameters:</B><DD><CODE>rotateContents</CODE> - <CODE>true</CODE> to set auto-rotation, <CODE>false</CODE> otherwise</DL></DD></DL><HR><A NAME="setEncryption(byte[], byte[], int, boolean)"><!-- --></A><H3>setEncryption</H3><PRE>public void <B>setEncryption</B>(byte[] userPassword, byte[] ownerPassword, int permissions, boolean strength128Bits) throws <A HREF="../../../../com/lowagie/text/DocumentException.html" title="class in com.lowagie.text">DocumentException</A></PRE><DL><DD>Sets the encryption options for this document. The userPassword and the ownerPassword can be null or have zero length. In this case the ownerPassword is replaced by a random string. The open permissions for the document can be AllowPrinting, AllowModifyContents, AllowCopy, AllowModifyAnnotations, AllowFillIn, AllowScreenReaders, AllowAssembly and AllowDegradedPrinting. The permissions can be combined by ORing them.<P><DD><DL></DL></DD><DD><DL><DT><B>Parameters:</B><DD><CODE>userPassword</CODE> - the user password. Can be null or empty<DD><CODE>ownerPassword</CODE> - the owner password. Can be null or empty<DD><CODE>permissions</CODE> - the user permissions<DD><CODE>strength128Bits</CODE> - <code>true</code> for 128 bit key length, <code>false</code> for 40 bit key length<DT><B>Throws:</B><DD><CODE><A HREF="../../../../com/lowagie/text/DocumentException.html" title="class in com.lowagie.text">DocumentException</A></CODE> - if anything was already written to the output</DL></DD></DL><HR><A NAME="setEncryption(byte[], byte[], int, int)"><!-- --></A><H3>setEncryption</H3><PRE>public void <B>setEncryption</B>(byte[] userPassword, byte[] ownerPassword, int permissions, int encryptionType) throws <A HREF="../../../../com/lowagie/text/DocumentException.html" title="class in com.lowagie.text">DocumentException</A></PRE><DL><DD>Sets the encryption options for this document. The userPassword and the ownerPassword can be null or have zero length. In this case the ownerPassword is replaced by a random string. The open permissions for the document can be AllowPrinting, AllowModifyContents, AllowCopy, AllowModifyAnnotations, AllowFillIn, AllowScreenReaders, AllowAssembly and AllowDegradedPrinting. The permissions can be combined by ORing them.<P><DD><DL><DT><B>Specified by:</B><DD><CODE><A HREF="../../../../com/lowagie/text/pdf/interfaces/PdfEncryptionSettings.html#setEncryption(byte[], byte[], int, int)">setEncryption</A></CODE> in interface <CODE><A HREF="../../../../com/lowagie/text/pdf/interfaces/PdfEncryptionSettings.html" title="interface in com.lowagie.text.pdf.interfaces">PdfEncryptionSettings</A></CODE></DL></DD><DD><DL><DT><B>Parameters:</B><DD><CODE>userPassword</CODE> - the user password. Can be null or empty<DD><CODE>ownerPassword</CODE> - the owner password. Can be null or empty<DD><CODE>permissions</CODE> - the user permissions<DD><CODE>encryptionType</CODE> - the type of encryption. It can be one of STANDARD_ENCRYPTION_40, STANDARD_ENCRYPTION_128 or ENCRYPTION_AES128. Optionally DO_NOT_ENCRYPT_METADATA can be ored to output the metadata in cleartext<DT><B>Throws:</B><DD><CODE><A HREF="../../../../com/lowagie/text/DocumentException.html" title="class in com.lowagie.text">DocumentException</A></CODE> - if the document is already open</DL></DD></DL><HR><A NAME="setEncryption(boolean, java.lang.String, java.lang.String, int)"><!-- --></A><H3>setEncryption</H3><PRE>public void <B>setEncryption</B>(boolean strength, <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> userPassword, <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> ownerPassword, int permissions) throws <A HREF="../../../../com/lowagie/text/DocumentException.html" title="class in com.lowagie.text">DocumentException</A></PRE><DL><DD>Sets the encryption options for this document. The userPassword and the ownerPassword can be null or have zero length. In this case the ownerPassword
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -