Skip to content

Commit b80ff8d

Browse files
fixed crashed internal tests
1 parent 2d9b0c2 commit b80ff8d

File tree

1 file changed

+6
-5
lines changed

1 file changed

+6
-5
lines changed

forms/src/main/java/com/itextpdf/forms/fields/PdfFormField.java

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1947,9 +1947,10 @@ public static Object[] splitDAelements(String da) {
19471947
*/
19481948
protected void drawTextAppearance(Rectangle rect, PdfFont font, int fontSize, String value, PdfFormXObject appearance) {
19491949
PdfStream stream = new PdfStream().makeIndirect(getDocument());
1950-
PdfCanvas canvas = new PdfCanvas(stream, appearance.getResources(), getDocument());
1950+
PdfResources resources = appearance.getResources();
1951+
PdfCanvas canvas = new PdfCanvas(stream, resources, getDocument());
19511952

1952-
setDefaultAppearance(generateDefaultAppearanceString(font, fontSize, appearance.getResources()));
1953+
setDefaultAppearance(generateDefaultAppearanceString(font, fontSize, resources));
19531954

19541955
float height = rect.getHeight();
19551956
float width = rect.getWidth();
@@ -2004,13 +2005,13 @@ protected void drawTextAppearance(Rectangle rect, PdfFont font, int fontSize, St
20042005
*/
20052006
protected void drawMultiLineTextAppearance(Rectangle rect, PdfFont font, int fontSize, String value, PdfFormXObject appearance) {
20062007
PdfStream stream = new PdfStream().makeIndirect(getDocument());
2007-
PdfCanvas canvas = new PdfCanvas(stream, new PdfResources(), getDocument());
2008+
PdfResources resources = appearance.getResources();
2009+
PdfCanvas canvas = new PdfCanvas(stream, resources, getDocument());
20082010

2009-
setDefaultAppearance(generateDefaultAppearanceString(font, fontSize, appearance.getResources()));
2011+
setDefaultAppearance(generateDefaultAppearanceString(font, fontSize, resources));
20102012

20112013
float width = rect.getWidth();
20122014
float height = rect.getHeight();
2013-
//PdfFormXObject xObject = new PdfFormXObject(new Rectangle(0, 0, width, height));
20142015

20152016
List<String> strings = font.splitString(value, fontSize, width - 6);
20162017

0 commit comments

Comments
 (0)