public class WriterProperties extends Object implements Serializable
Modifier and Type | Field and Description |
---|---|
protected boolean |
addXmpMetadata |
protected int |
compressionLevel |
protected boolean |
debugMode |
protected EncryptionProperties |
encryptionProperties |
protected PdfString |
initialDocumentId
The ID entry that represents the initial identifier.
|
protected Boolean |
isFullCompression
Indicates if to use full compression (using object streams).
|
protected PdfString |
modifiedDocumentId
The ID entry that represents a change in a document.
|
protected PdfVersion |
pdfVersion |
protected boolean |
smartMode
Indicates if the writer copy objects in a smart mode.
|
Constructor and Description |
---|
WriterProperties() |
Modifier and Type | Method and Description |
---|---|
WriterProperties |
addXmpMetadata()
If true, default XMPMetadata based on PdfDocumentInfo will be added.
|
WriterProperties |
setCompressionLevel(int compressionLevel)
Defines the level of compression for the document.
|
WriterProperties |
setFullCompressionMode(boolean fullCompressionMode)
Defines if full compression mode is enabled.
|
WriterProperties |
setInitialDocumentId(PdfString initialDocumentId)
The /ID entry of a document contains an array with two entries.
|
WriterProperties |
setModifiedDocumentId(PdfString modifiedDocumentId)
The /ID entry of a document contains an array with two entries.
|
WriterProperties |
setPdfVersion(PdfVersion version)
Defines pdf version for the created document.
|
WriterProperties |
setPublicKeyEncryption(Certificate[] certs, int[] permissions, int encryptionAlgorithm)
Sets the certificate encryption options for the document.
|
WriterProperties |
setStandardEncryption(byte[] userPassword, byte[] ownerPassword, int permissions, int encryptionAlgorithm)
Sets the encryption options for the document.
|
WriterProperties |
useDebugMode()
This activates debug mode with pdfDebug tool.
|
WriterProperties |
useSmartMode()
Enables smart mode.
|
protected int compressionLevel
protected Boolean isFullCompression
protected boolean smartMode
protected boolean debugMode
protected boolean addXmpMetadata
protected PdfVersion pdfVersion
protected EncryptionProperties encryptionProperties
protected PdfString initialDocumentId
protected PdfString modifiedDocumentId
public WriterProperties setPdfVersion(PdfVersion version)
version
- version for the document.
WriterProperties
instance
public WriterProperties useSmartMode()
WriterProperties
instance
public WriterProperties addXmpMetadata()
PdfDocumentInfo
will be added.
WriterProperties
instance
public WriterProperties setCompressionLevel(int compressionLevel)
CompressionConstants
compressionLevel
-
WriterProperties
instance
public WriterProperties setFullCompressionMode(boolean fullCompressionMode)
fullCompressionMode
- true - to enable full compression mode, false to disable it
WriterProperties
instance
public WriterProperties setStandardEncryption(byte[] userPassword, byte[] ownerPassword, int permissions, int encryptionAlgorithm)
See EncryptionConstants
.
userPassword
- the user password. Can be null or empty
ownerPassword
- the owner password. Can be null or empty
permissions
- the user permissions
encryptionAlgorithm
- the type of encryption. It can be one of STANDARD_ENCRYPTION_40, STANDARD_ENCRYPTION_128, ENCRYPTION_AES128 or ENCRYPTION_AES256 Optionally DO_NOT_ENCRYPT_METADATA can be ored to output the metadata in cleartext
WriterProperties
instance
public WriterProperties setPublicKeyEncryption(Certificate[] certs, int[] permissions, int encryptionAlgorithm)
See EncryptionConstants
.
certs
- the public certificates to be used for the encryption
permissions
- the user permissions for each of the certificates
encryptionAlgorithm
- the type of encryption. It can be one of STANDARD_ENCRYPTION_40, STANDARD_ENCRYPTION_128, ENCRYPTION_AES128 or ENCRYPTION_AES256.
WriterProperties
instance
public WriterProperties setInitialDocumentId(PdfString initialDocumentId)
initialDocumentId
- the new initial document id
WriterProperties
instance
public WriterProperties setModifiedDocumentId(PdfString modifiedDocumentId)
modifiedDocumentId
- the new modified document id
WriterProperties
instance
public WriterProperties useDebugMode()
WriterProperties
instance
Copyright © 1998–2018 iText Group NV. All rights reserved.