📄 pdfcopyfields.html
字号:
</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 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 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>strength</CODE> - true for 128 bit key length. false for 40 bit key length<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<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="close()"><!-- --></A><H3>close</H3><PRE>public void <B>close</B>()</PRE><DL><DD>Closes the output document.<P><DD><DL></DL></DD><DD><DL></DL></DD></DL><HR><A NAME="open()"><!-- --></A><H3>open</H3><PRE>public void <B>open</B>()</PRE><DL><DD>Opens the document. This is usually not needed as addDocument() will do it automatically.<P><DD><DL></DL></DD><DD><DL></DL></DD></DL><HR><A NAME="addJavaScript(java.lang.String)"><!-- --></A><H3>addJavaScript</H3><PRE>public void <B>addJavaScript</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> js)</PRE><DL><DD>Adds JavaScript to the global document<P><DD><DL></DL></DD><DD><DL><DT><B>Parameters:</B><DD><CODE>js</CODE> - the JavaScript</DL></DD></DL><HR><A NAME="setOutlines(java.util.List)"><!-- --></A><H3>setOutlines</H3><PRE>public void <B>setOutlines</B>(<A HREF="http://java.sun.com/j2se/1.4/docs/api/java/util/List.html?is-external=true" title="class or interface in java.util">List</A> outlines)</PRE><DL><DD>Sets the bookmarks. The list structure is defined in <CODE>SimpleBookmark#</CODE>.<P><DD><DL></DL></DD><DD><DL><DT><B>Parameters:</B><DD><CODE>outlines</CODE> - the bookmarks or <CODE>null</CODE> to remove any</DL></DD></DL><HR><A NAME="getWriter()"><!-- --></A><H3>getWriter</H3><PRE>public <A HREF="../../../../com/lowagie/text/pdf/PdfWriter.html" title="class in com.lowagie.text.pdf">PdfWriter</A> <B>getWriter</B>()</PRE><DL><DD>Gets the underlying PdfWriter.<P><DD><DL></DL></DD><DD><DL><DT><B>Returns:</B><DD>the underlying PdfWriter</DL></DD></DL><HR><A NAME="isFullCompression()"><!-- --></A><H3>isFullCompression</H3><PRE>public boolean <B>isFullCompression</B>()</PRE><DL><DD>Gets the 1.5 compression status.<P><DD><DL></DL></DD><DD><DL><DT><B>Returns:</B><DD><code>true</code> if the 1.5 compression is on</DL></DD></DL><HR><A NAME="setFullCompression()"><!-- --></A><H3>setFullCompression</H3><PRE>public void <B>setFullCompression</B>()</PRE><DL><DD>Sets the document's compression to the new 1.5 mode with object streams and xref streams. It can be set at any time but once set it can't be unset. <p> If set before opening the document it will also set the pdf version to 1.5.<P><DD><DL></DL></DD><DD><DL></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><B>Description copied from interface: <CODE><A HREF="../../../../com/lowagie/text/pdf/interfaces/PdfEncryptionSettings.html#setEncryption(byte[], byte[], int, int)">PdfEncryptionSettings</A></CODE></B></DD><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<DT><B>See Also:</B><DD><A HREF="../../../../com/lowagie/text/pdf/interfaces/PdfEncryptionSettings.html#setEncryption(byte[], byte[], int, int)"><CODE>PdfEncryptionSettings.setEncryption(byte[], byte[], int, int)</CODE></A></DL></DD></DL><HR><A NAME="addViewerPreference(com.lowagie.text.pdf.PdfName, com.lowagie.text.pdf.PdfObject)"><!-- --></A><H3>addViewerPreference</H3><PRE>public void <B>addViewerPreference</B>(<A HREF="../../../../com/lowagie/text/pdf/PdfName.html" title="class in com.lowagie.text.pdf">PdfName</A> key, <A HREF="../../../../com/lowagie/text/pdf/PdfObject.html" title="class in com.lowagie.text.pdf">PdfObject</A> value)</PRE><DL><DD><B>Description copied from interface: <CODE><A HREF="../../../../com/lowagie/text/pdf/interfaces/PdfViewerPreferences.html#addViewerPreference(com.lowagie.text.pdf.PdfName, com.lowagie.text.pdf.PdfObject)">PdfViewerPreferences</A></CODE></B></DD><DD>Adds a viewer preference. <ul> <li>In case the key is one of these values: <ul> <li>PdfName.<b>HIDETOOLBAR</b> <li>PdfName.<b>HIDEMENUBAR</b> <li>PdfName.<b>HIDEWINDOWUI</b> <li>PdfName.<b>FITWINDOW</b> <li>PdfName.<b>CENTERWINDOW</b> <li>PdfName.<b>DISPLAYDOCTITLE</b> </ul> The value must be a of type PdfBoolean (true or false). <li>In case the key is PdfName.<b>NONFULLSCREENPAGEMODE</b>, the value must be one of these names:
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -