@@ -52,7 +52,6 @@ This file is part of the iText (R) project.
52
52
import com .itextpdf .kernel .pdf .PdfBoolean ;
53
53
import com .itextpdf .kernel .pdf .PdfDictionary ;
54
54
import com .itextpdf .kernel .pdf .PdfDocument ;
55
- import com .itextpdf .kernel .pdf .PdfIndirectReference ;
56
55
import com .itextpdf .kernel .pdf .PdfName ;
57
56
import com .itextpdf .kernel .pdf .PdfNumber ;
58
57
import com .itextpdf .kernel .pdf .PdfObject ;
@@ -65,6 +64,8 @@ This file is part of the iText (R) project.
65
64
import com .itextpdf .kernel .pdf .tagutils .TagReference ;
66
65
import com .itextpdf .kernel .pdf .tagutils .TagTreePointer ;
67
66
import com .itextpdf .kernel .pdf .xobject .PdfFormXObject ;
67
+ import org .slf4j .Logger ;
68
+ import org .slf4j .LoggerFactory ;
68
69
69
70
import java .util .ArrayList ;
70
71
import java .util .Arrays ;
@@ -74,9 +75,6 @@ This file is part of the iText (R) project.
74
75
import java .util .Map ;
75
76
import java .util .Set ;
76
77
77
- import org .slf4j .Logger ;
78
- import org .slf4j .LoggerFactory ;
79
-
80
78
/**
81
79
* This class represents the static form technology AcroForm on a PDF file.
82
80
*/
@@ -129,7 +127,6 @@ public class PdfAcroForm extends PdfObjectWrapper<PdfDictionary> {
129
127
*/
130
128
protected PdfDocument document ;
131
129
132
- Logger logger = LoggerFactory .getLogger (PdfAcroForm .class );
133
130
private static PdfName [] resourceNames = {PdfName .Font , PdfName .XObject , PdfName .ColorSpace , PdfName .Pattern };
134
131
private PdfDictionary defaultResources ;
135
132
private Set <PdfFormField > fieldsForFlattening = new LinkedHashSet <>();
@@ -178,7 +175,6 @@ public static PdfAcroForm getAcroForm(PdfDocument document, boolean createIfNotE
178
175
acroForm .makeIndirect (document );
179
176
document .getCatalog ().put (PdfName .AcroForm , acroForm .getPdfObject ());
180
177
document .getCatalog ().setModified ();
181
- acroForm .setDefaultAppearance ("/Helv 0 Tf 0 g " );
182
178
}
183
179
} else {
184
180
acroForm = new PdfAcroForm (acroFormDictionary , document );
@@ -839,6 +835,7 @@ public void replaceField(String name, PdfFormField field) {
839
835
protected PdfArray getFields () {
840
836
PdfArray fields = getPdfObject ().getAsArray (PdfName .Fields );
841
837
if (fields == null ) {
838
+ Logger logger = LoggerFactory .getLogger (PdfAcroForm .class );
842
839
logger .warn (LogMessageConstant .NO_FIELDS_IN_ACROFORM );
843
840
fields = new PdfArray ();
844
841
getPdfObject ().put (PdfName .Fields , fields );
@@ -855,6 +852,7 @@ private Map<String, PdfFormField> iterateFields(PdfArray array, Map<String, PdfF
855
852
int index = 1 ;
856
853
for (PdfObject field : array ) {
857
854
if (field .isFlushed ()) {
855
+ Logger logger = LoggerFactory .getLogger (PdfAcroForm .class );
858
856
logger .warn (LogMessageConstant .FORM_FIELD_WAS_FLUSHED );
859
857
continue ;
860
858
}
0 commit comments