|
![]() |
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.lowagie.text.pdf.PdfCopyFields
public class PdfCopyFields
Concatenates PDF documents including form fields. The rules for the form field concatenation are the same as in Acrobat. All the documents are kept in memory unlike PdfCopy.
Field Summary | |
---|---|
private PdfCopyFieldsImp |
fc
|
Constructor Summary | |
---|---|
PdfCopyFields(OutputStream os)
Creates a new instance. |
|
PdfCopyFields(OutputStream os,
char pdfVersion)
Creates a new instance. |
Method Summary | |
---|---|
void |
addDocument(PdfReader reader)
Concatenates a PDF document. |
void |
addDocument(PdfReader reader,
List pagesToKeep)
Concatenates a PDF document selecting the pages to keep. |
void |
addDocument(PdfReader reader,
String ranges)
Concatenates a PDF document selecting the pages to keep. |
void |
addJavaScript(String js)
Adds JavaScript to the global document |
void |
addViewerPreference(PdfName key,
PdfObject value)
Adds a viewer preference. |
void |
close()
Closes the output document. |
PdfWriter |
getWriter()
Gets the underlying PdfWriter. |
boolean |
isFullCompression()
Gets the 1.5 compression status. |
void |
open()
Opens the document. |
void |
setEncryption(boolean strength,
String userPassword,
String ownerPassword,
int permissions)
Sets the encryption options for this document. |
void |
setEncryption(byte[] userPassword,
byte[] ownerPassword,
int permissions,
boolean strength128Bits)
Sets the encryption options for this document. |
void |
setEncryption(byte[] userPassword,
byte[] ownerPassword,
int permissions,
int encryptionType)
Sets the encryption options for this document. |
void |
setEncryption(Certificate[] certs,
int[] permissions,
int encryptionType)
Sets the certificate encryption options for this document. |
void |
setFullCompression()
Sets the document's compression to the new 1.5 mode with object streams and xref streams. |
void |
setOutlines(List outlines)
Sets the bookmarks. |
void |
setViewerPreferences(int preferences)
Sets the page layout and page mode preferences by ORing one or two of these constants. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
private PdfCopyFieldsImp fc
Constructor Detail |
---|
public PdfCopyFields(OutputStream os) throws DocumentException
os
- the output stream
DocumentException
- on errorpublic PdfCopyFields(OutputStream os, char pdfVersion) throws DocumentException
os
- the output streampdfVersion
- the pdf version the output will have
DocumentException
- on errorMethod Detail |
---|
public void addDocument(PdfReader reader) throws DocumentException, IOException
reader
- the PDF document
DocumentException
- on error
IOException
public void addDocument(PdfReader reader, List 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 keep
DocumentException
- on error
IOException
public void addDocument(PdfReader reader, String ranges) throws DocumentException, IOException
reader
- the PDF documentranges
- the comma separated ranges as described in SequenceList
DocumentException
- on error
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 length
DocumentException
- 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 permissions
DocumentException
- if the document is already openpublic void close()
public void open()
public void addJavaScript(String js)
js
- the JavaScriptpublic void setOutlines(List 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()
If set before opening the document it will also set the pdf version to 1.5.
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 cleartext
DocumentException
- 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.lowagie.text.pdf.PdfName, com.lowagie.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(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)
|
Hosted by Hostbasket | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |