@@ -64,6 +64,7 @@ public class WriterProperties implements Serializable {
64
64
protected boolean smartMode ;
65
65
protected boolean debugMode ;
66
66
protected boolean addXmpMetadata ;
67
+ protected boolean pdfUA ;
67
68
protected PdfVersion pdfVersion ;
68
69
protected EncryptionProperties encryptionProperties ;
69
70
/**
@@ -79,6 +80,7 @@ public class WriterProperties implements Serializable {
79
80
public WriterProperties () {
80
81
smartMode = false ;
81
82
debugMode = false ;
83
+ pdfUA = false ;
82
84
compressionLevel = CompressionConstants .DEFAULT_COMPRESSION ;
83
85
isFullCompression = null ;
84
86
encryptionProperties = new EncryptionProperties ();
@@ -182,7 +184,7 @@ public WriterProperties setStandardEncryption(byte[] userPassword, byte[] ownerP
182
184
* <p>
183
185
* @param certs the public certificates to be used for the encryption
184
186
* @param permissions the user permissions for each of the certificates
185
- * @param encryptionType the type of encryption. It can be one of {@link EncryptionConstants#STANDARD_ENCRYPTION_40},
187
+ * @param encryptionAlgorithm the type of encryption. It can be one of {@link EncryptionConstants#STANDARD_ENCRYPTION_40},
186
188
* {@link EncryptionConstants#STANDARD_ENCRYPTION_128}, {@link EncryptionConstants#ENCRYPTION_AES_128}
187
189
* or {@link EncryptionConstants#ENCRYPTION_AES_256}.
188
190
* Optionally {@link EncryptionConstants#DO_NOT_ENCRYPT_METADATA} can be ORed to output the metadata in cleartext
@@ -234,6 +236,18 @@ public WriterProperties useDebugMode() {
234
236
return this ;
235
237
}
236
238
239
+ /**
240
+ * This method marks the document as PDF/UA and sets related flags is XMPMetaData.
241
+ * NOTE: iText does not validate PDF/UA, which means we don't check if created PDF meets all PDF/UA requirements.
242
+ * Don't use this method if you are not familiar with PDF/UA specification in order to avoid creation of non-conformant PDF/UA file.
243
+ *
244
+ * @return this {@code WriterProperties} instance
245
+ */
246
+ public WriterProperties setPdfUA () {
247
+ this .pdfUA = true ;
248
+ return this ;
249
+ }
250
+
237
251
boolean isStandardEncryptionUsed () {
238
252
return encryptionProperties .isStandardEncryptionUsed ();
239
253
}
0 commit comments