Skip to content

Commit 7d461dc

Browse files
committed
Use renderers to render push button form field appearance
DEVSIX-7359
1 parent 275dd21 commit 7d461dc

File tree

54 files changed

+7
-7
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

54 files changed

+7
-7
lines changed

src/main/java/com/itextpdf/html2pdf/attach/impl/tags/ButtonTagWorker.java

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,6 @@ This file is part of the iText (R) project.
4545
import com.itextpdf.forms.form.FormProperty;
4646
import com.itextpdf.forms.form.element.Button;
4747
import com.itextpdf.forms.form.element.IFormField;
48-
import com.itextpdf.forms.form.element.InputButton;
4948
import com.itextpdf.html2pdf.attach.ITagWorker;
5049
import com.itextpdf.html2pdf.attach.ProcessorContext;
5150
import com.itextpdf.html2pdf.attach.util.AccessiblePropHelper;
@@ -139,9 +138,9 @@ public IPropertyContainer getElementResult() {
139138
div.getChildren().clear();
140139
formField = button;
141140
} else {
142-
InputButton inputButton = new InputButton(name);
141+
Button inputButton = new Button(name);
143142
inputButton.setProperty(FormProperty.FORM_ACCESSIBILITY_LANGUAGE, lang);
144-
inputButton.setProperty(FormProperty.FORM_FIELD_VALUE, fallbackContent.toString().trim());
143+
inputButton.setValue(fallbackContent.toString().trim());
145144
formField = inputButton;
146145
}
147146
}

src/main/java/com/itextpdf/html2pdf/attach/impl/tags/InputTagWorker.java

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -45,8 +45,8 @@ This file is part of the iText (R) project.
4545
import com.itextpdf.commons.utils.ExperimentalFeatures;
4646
import com.itextpdf.commons.utils.MessageFormatUtil;
4747
import com.itextpdf.forms.form.FormProperty;
48+
import com.itextpdf.forms.form.element.Button;
4849
import com.itextpdf.forms.form.element.CheckBox;
49-
import com.itextpdf.forms.form.element.InputButton;
5050
import com.itextpdf.forms.form.element.InputField;
5151
import com.itextpdf.forms.form.element.Radio;
5252
import com.itextpdf.html2pdf.attach.ITagWorker;
@@ -138,8 +138,7 @@ public InputTagWorker(IElementNode element, ProcessorContext context) {
138138
formElement.setProperty(FormProperty.FORM_FIELD_PASSWORD_FLAG, true);
139139
}
140140
} else if (AttributeConstants.SUBMIT.equals(inputType) || AttributeConstants.BUTTON.equals(inputType)) {
141-
formElement = new InputButton(name);
142-
formElement.setProperty(FormProperty.FORM_FIELD_VALUE, value);
141+
formElement = new Button(name).setSingleLineValue(value);
143142
} else if (AttributeConstants.CHECKBOX.equals(inputType)) {
144143
CheckBox cb = new CheckBox(name);
145144
String checked = element.getAttribute(AttributeConstants.CHECKED);

src/test/java/com/itextpdf/html2pdf/element/FormTest.java

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -175,7 +175,8 @@ public void buttonSplit01Test() throws IOException, InterruptedException {
175175

176176
@Test
177177
@LogMessages(messages = {
178-
@LogMessage(messageTemplate = LayoutLogMessageConstant.ELEMENT_DOES_NOT_FIT_AREA, count = 2),
178+
@LogMessage(messageTemplate = LayoutLogMessageConstant.ELEMENT_DOES_NOT_FIT_AREA, count = 4),
179+
@LogMessage(messageTemplate = FormsLogMessageConstants.INPUT_FIELD_DOES_NOT_FIT, count = 2)
179180
})
180181
public void buttonSplit02Test() throws IOException, InterruptedException {
181182
runTest("buttonSplit02");
@@ -184,6 +185,7 @@ public void buttonSplit02Test() throws IOException, InterruptedException {
184185
@Test
185186
@LogMessages(messages = {
186187
@LogMessage(messageTemplate = LayoutLogMessageConstant.ELEMENT_DOES_NOT_FIT_AREA, count = 2),
188+
@LogMessage(messageTemplate = FormsLogMessageConstants.INPUT_FIELD_DOES_NOT_FIT, count = 2)
187189
})
188190
public void buttonSplit03Test() throws IOException, InterruptedException {
189191
runTest("buttonSplit03");
496 Bytes
Binary file not shown.
-1.2 KB
Binary file not shown.
110 Bytes
Binary file not shown.
83 Bytes
Binary file not shown.
80 Bytes
Binary file not shown.
-74 Bytes
Binary file not shown.
-1 Bytes
Binary file not shown.

0 commit comments

Comments
 (0)