Skip to content

Commit b406203

Browse files
author
Evgeniy Prudnikov
committed
Reduce logging level to WARN while flattening a signature field without N entry
DEVSIX-4920
1 parent 8db4d3e commit b406203

File tree

4 files changed

+10
-2
lines changed

4 files changed

+10
-2
lines changed

forms/src/main/java/com/itextpdf/forms/PdfAcroForm.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -721,7 +721,7 @@ public void flattenFields() {
721721
}
722722
}
723723
} else {
724-
LOGGER.error(IoLogMessageConstant.N_ENTRY_IS_REQUIRED_FOR_APPEARANCE_DICTIONARY);
724+
LOGGER.warn(FormsExceptionMessageConstant.N_ENTRY_IS_REQUIRED_FOR_APPEARANCE_DICTIONARY);
725725
}
726726

727727
PdfArray fFields = getFields();

forms/src/main/java/com/itextpdf/forms/exceptions/FormsExceptionMessageConstant.java

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,5 +34,8 @@ public final class FormsExceptionMessageConstant {
3434
public static final String WRONG_FORM_FIELD_ADD_ANNOTATION_TO_THE_FIELD = "Wrong form field. Add annotation to the "
3535
+ "field.";
3636

37+
public static final String N_ENTRY_IS_REQUIRED_FOR_APPEARANCE_DICTIONARY =
38+
"\\N entry is required to be present in an appearance dictionary.";
39+
3740
private FormsExceptionMessageConstant(){}
3841
}

forms/src/test/java/com/itextpdf/forms/FlatteningTest.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,7 @@ This file is part of the iText (R) project.
4242
*/
4343
package com.itextpdf.forms;
4444

45+
import com.itextpdf.forms.exceptions.FormsExceptionMessageConstant;
4546
import com.itextpdf.io.logs.IoLogMessageConstant;
4647
import com.itextpdf.kernel.pdf.PdfDocument;
4748
import com.itextpdf.kernel.pdf.PdfReader;
@@ -83,7 +84,7 @@ public void flatteningFormFieldNoSubtypeInAPTest() throws IOException, Interrupt
8384
}
8485

8586
@Test
86-
@LogMessages(messages = @LogMessage(messageTemplate = IoLogMessageConstant.N_ENTRY_IS_REQUIRED_FOR_APPEARANCE_DICTIONARY))
87+
@LogMessages(messages = @LogMessage(messageTemplate = FormsExceptionMessageConstant.N_ENTRY_IS_REQUIRED_FOR_APPEARANCE_DICTIONARY))
8788
public void formFlatteningTestWithoutNEntry() throws IOException, InterruptedException {
8889
String filename = "formFlatteningTestWithoutNEntry";
8990
String src = sourceFolder + filename + ".pdf";

io/src/main/java/com/itextpdf/io/logs/IoLogMessageConstant.java

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -370,6 +370,10 @@ public final class IoLogMessageConstant {
370370
public static final String NUM_TREE_SHALL_NOT_END_WITH_KEY =
371371
"Number tree ends with a key which is invalid according to the PDF specification.";
372372

373+
/**
374+
* @deprecated Unused constant. Will be removed in 7.3
375+
*/
376+
@Deprecated
373377
public static final String N_ENTRY_IS_REQUIRED_FOR_APPEARANCE_DICTIONARY =
374378
"\\N entry is required to be present in an appearance dictionary.";
375379

0 commit comments

Comments
 (0)