@Deprecated public class PdfCopyFields extends Object implements PdfViewerPreferences, PdfEncryptionSettings
| Constructor and Description |
|---|
PdfCopyFields(OutputStream os)
Deprecated.
Creates a new instance.
|
PdfCopyFields(OutputStream os,
char pdfVersion)
Deprecated.
Creates a new instance.
|
| Modifier and Type | Method and Description |
|---|---|
void |
addDocument(PdfReader reader)
Deprecated.
Concatenates a PDF document.
|
void |
addDocument(PdfReader reader,
List<Integer> pagesToKeep)
Deprecated.
Concatenates a PDF document selecting the pages to keep.
|
void |
addDocument(PdfReader reader,
String ranges)
Deprecated.
Concatenates a PDF document selecting the pages to keep.
|
void |
addJavaScript(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,
String userPassword,
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(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(List<HashMap<String,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(OutputStream os) throws DocumentException
os - the output streamDocumentException - on errorpublic PdfCopyFields(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, IOException
reader - the PDF documentDocumentException - on errorIOExceptionpublic void addDocument(PdfReader reader, List<Integer> pagesToKeep) throws DocumentException, 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 errorIOExceptionpublic void addDocument(PdfReader reader, String ranges) throws DocumentException, IOException
reader - the PDF documentranges - the comma separated ranges as described in SequenceListDocumentException - on errorIOExceptionpublic 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,
String userPassword,
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(String js)
js - the JavaScriptpublic void setOutlines(List<HashMap<String,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
DocumentExceptionpublic void setEncryption(byte[] userPassword,
byte[] ownerPassword,
int permissions,
int encryptionType)
throws DocumentException
PdfEncryptionSettingssetEncryption in interface PdfEncryptionSettingsuserPassword - 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)
PdfViewerPreferencesaddViewerPreference in interface PdfViewerPreferenceskey - 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 PdfViewerPreferencespreferences - the viewer preferencesPdfViewerPreferences.setViewerPreferences(int)public void setEncryption(Certificate[] certs, int[] permissions, int encryptionType) throws DocumentException
PdfEncryptionSettingssetEncryption in interface PdfEncryptionSettingscerts - 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 © 2024. All rights reserved.