PdfEncryptionSettings
, PdfViewerPreferences
@Deprecated public class PdfCopyFields extends java.lang.Object implements PdfViewerPreferences, PdfEncryptionSettings
Constructor | Description |
---|---|
PdfCopyFields(java.io.OutputStream os) |
Deprecated.
Creates a new instance.
|
PdfCopyFields(java.io.OutputStream os,
char pdfVersion) |
Deprecated.
Creates a new instance.
|
Modifier and Type | Method | Description |
---|---|---|
void |
addDocument(PdfReader reader) |
Deprecated.
Concatenates a PDF document.
|
void |
addDocument(PdfReader reader,
java.lang.String ranges) |
Deprecated.
Concatenates a PDF document selecting the pages to keep.
|
void |
addDocument(PdfReader reader,
java.util.List<java.lang.Integer> pagesToKeep) |
Deprecated.
Concatenates a PDF document selecting the pages to keep.
|
void |
addJavaScript(java.lang.String js) |
Deprecated.
Adds JavaScript to the global document
|
void |
addViewerPreference(PdfName key,
PdfObject value) |
Deprecated.
Adds a viewer preference.
|
void |
close() |
Deprecated.
Closes the output document.
|
PdfWriter |
getWriter() |
Deprecated.
Gets the underlying PdfWriter.
|
boolean |
isFullCompression() |
Deprecated.
Gets the 1.5 compression status.
|
void |
open() |
Deprecated.
Opens the document.
|
void |
setEncryption(boolean strength,
java.lang.String userPassword,
java.lang.String ownerPassword,
int permissions) |
Deprecated.
Sets the encryption options for this document.
|
void |
setEncryption(byte[] userPassword,
byte[] ownerPassword,
int permissions,
boolean strength128Bits) |
Deprecated.
Sets the encryption options for this document.
|
void |
setEncryption(byte[] userPassword,
byte[] ownerPassword,
int permissions,
int encryptionType) |
Deprecated.
Sets the encryption options for this document.
|
void |
setEncryption(java.security.cert.Certificate[] certs,
int[] permissions,
int encryptionType) |
Deprecated.
Sets the certificate encryption options for this document.
|
void |
setFullCompression() |
Deprecated.
Sets the document's compression to the new 1.5 mode with object streams and xref
streams.
|
void |
setOutlines(java.util.List<java.util.HashMap<java.lang.String,java.lang.Object>> outlines) |
Deprecated.
Sets the bookmarks.
|
void |
setViewerPreferences(int preferences) |
Deprecated.
Sets the page layout and page mode preferences by ORing one or two of these constants.
|
public PdfCopyFields(java.io.OutputStream os) throws DocumentException
os
- the output streamDocumentException
- on errorpublic PdfCopyFields(java.io.OutputStream os, char pdfVersion) throws DocumentException
os
- the output streampdfVersion
- the pdf version the output will haveDocumentException
- on errorpublic void addDocument(PdfReader reader) throws DocumentException, java.io.IOException
reader
- the PDF documentDocumentException
- on errorjava.io.IOException
public void addDocument(PdfReader reader, java.util.List<java.lang.Integer> pagesToKeep) throws DocumentException, java.io.IOException
List
of Integer
. The page ordering can be changed but
no page repetitions are allowed.reader
- the PDF documentpagesToKeep
- the pages to keepDocumentException
- on errorjava.io.IOException
public void addDocument(PdfReader reader, java.lang.String ranges) throws DocumentException, java.io.IOException
reader
- the PDF documentranges
- the comma separated ranges as described in SequenceList
DocumentException
- on errorjava.io.IOException
public void setEncryption(byte[] userPassword, byte[] ownerPassword, int permissions, boolean strength128Bits) throws DocumentException
userPassword
- the user password. Can be null or emptyownerPassword
- the owner password. Can be null or emptypermissions
- the user permissionsstrength128Bits
- true
for 128 bit key length, false
for 40 bit key lengthDocumentException
- if the document is already openpublic void setEncryption(boolean strength, java.lang.String userPassword, java.lang.String ownerPassword, int permissions) throws DocumentException
strength
- true for 128 bit key length. false for 40 bit key lengthuserPassword
- the user password. Can be null or emptyownerPassword
- the owner password. Can be null or emptypermissions
- the user permissionsDocumentException
- if the document is already openpublic void close()
public void open()
public void addJavaScript(java.lang.String js)
js
- the JavaScriptpublic void setOutlines(java.util.List<java.util.HashMap<java.lang.String,java.lang.Object>> outlines)
SimpleBookmark#
.outlines
- the bookmarks or null
to remove anypublic PdfWriter getWriter()
public boolean isFullCompression()
true
if the 1.5 compression is onpublic void setFullCompression() throws DocumentException
DocumentException
public void setEncryption(byte[] userPassword, byte[] ownerPassword, int permissions, int encryptionType) throws DocumentException
PdfEncryptionSettings
setEncryption
in interface PdfEncryptionSettings
userPassword
- the user password. Can be null or emptyownerPassword
- the owner password. Can be null or emptypermissions
- the user permissionsencryptionType
- 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 cleartextDocumentException
- if the document is already openPdfEncryptionSettings.setEncryption(byte[], byte[], int, int)
public void addViewerPreference(PdfName key, PdfObject value)
PdfViewerPreferences
addViewerPreference
in interface PdfViewerPreferences
key
- the name of the viewer preferencevalue
- the value of the viewer preferencePdfViewerPreferences.addViewerPreference(com.itextpdf.text.pdf.PdfName, com.itextpdf.text.pdf.PdfObject)
public void setViewerPreferences(int preferences)
PdfViewerPreferences
addViewerPreference(key, value)
if you want to change the following preferences:
setViewerPreferences
in interface PdfViewerPreferences
preferences
- the viewer preferencesPdfViewerPreferences.setViewerPreferences(int)
public void setEncryption(java.security.cert.Certificate[] certs, int[] permissions, int encryptionType) throws DocumentException
PdfEncryptionSettings
setEncryption
in interface PdfEncryptionSettings
certs
- the public certificates to be used for the encryptionpermissions
- the user permissions for each of the certificatesencryptionType
- the type of encryption. It can be one of STANDARD_ENCRYPTION_40, STANDARD_ENCRYPTION_128 or ENCRYPTION_AES128.DocumentException
- if the document is already openPdfEncryptionSettings.setEncryption(java.security.cert.Certificate[], int[], int)
Copyright © 1998–2018. All rights reserved.