Skip to content

Commit 1096007

Browse files
pavel-alayLodrKumquat
authored andcommitted
Rename setPdfUA() to addUAXmpMetadata
DEVSIX-629
1 parent 57a88d5 commit 1096007

File tree

2 files changed

+8
-7
lines changed

2 files changed

+8
-7
lines changed

kernel/src/main/java/com/itextpdf/kernel/pdf/PdfDocument.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1845,7 +1845,7 @@ protected XMPMeta updateDefaultXmpMetadata() throws XMPException {
18451845
XMPMeta xmpMeta = XMPMetaFactory.parseFromBuffer(getXmpMetadata(true));
18461846
XmpMetaInfoConverter.appendDocumentInfoToMetadata(info, xmpMeta);
18471847

1848-
if (isTagged() && writer.properties.pdfUA && !isXmpMetaHasProperty(xmpMeta, XMPConst.NS_PDFUA_ID, XMPConst.PART)) {
1848+
if (isTagged() && writer.properties.addUAXmpMetadata && !isXmpMetaHasProperty(xmpMeta, XMPConst.NS_PDFUA_ID, XMPConst.PART)) {
18491849
xmpMeta.setPropertyInteger(XMPConst.NS_PDFUA_ID, XMPConst.PART, 1, new PropertyOptions(PropertyOptions.SEPARATE_NODE));
18501850
}
18511851

kernel/src/main/java/com/itextpdf/kernel/pdf/WriterProperties.java

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ public class WriterProperties implements Serializable {
6464
protected boolean smartMode;
6565
protected boolean debugMode;
6666
protected boolean addXmpMetadata;
67-
protected boolean pdfUA;
67+
protected boolean addUAXmpMetadata;
6868
protected PdfVersion pdfVersion;
6969
protected EncryptionProperties encryptionProperties;
7070
/**
@@ -80,7 +80,7 @@ public class WriterProperties implements Serializable {
8080
public WriterProperties() {
8181
smartMode = false;
8282
debugMode = false;
83-
pdfUA = false;
83+
addUAXmpMetadata = false;
8484
compressionLevel = CompressionConstants.DEFAULT_COMPRESSION;
8585
isFullCompression = null;
8686
encryptionProperties = new EncryptionProperties();
@@ -128,7 +128,7 @@ public WriterProperties addXmpMetadata() {
128128
* Defines the level of compression for the document.
129129
* See {@link CompressionConstants}
130130
*
131-
* @param compressionLevel
131+
* @param compressionLevel {@link CompressionConstants} value.
132132
* @return this {@code WriterProperties} instance
133133
*/
134134
public WriterProperties setCompressionLevel(int compressionLevel) {
@@ -238,14 +238,15 @@ public WriterProperties useDebugMode() {
238238

239239
/**
240240
* This method marks the document as PDF/UA and sets related flags is XMPMetaData.
241+
* This method calls {@link #addXmpMetadata()} implicitly.
241242
* NOTE: iText does not validate PDF/UA, which means we don't check if created PDF meets all PDF/UA requirements.
242243
* 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.
243244
*
244245
* @return this {@code WriterProperties} instance
245246
*/
246-
public WriterProperties setPdfUA() {
247-
this.pdfUA = true;
248-
return this;
247+
public WriterProperties addUAXmpMetadata() {
248+
this.addUAXmpMetadata = true;
249+
return addXmpMetadata();
249250
}
250251

251252
boolean isStandardEncryptionUsed() {

0 commit comments

Comments
 (0)