Skip to content

Commit 35ff293

Browse files
committed
Make DA's float formatting consistent in Java and C#
DEVSIX-1401
1 parent 6b9ef39 commit 35ff293

File tree

3 files changed

+3
-3
lines changed

3 files changed

+3
-3
lines changed

kernel/src/main/java/com/itextpdf/kernel/pdf/annot/da/AnnotationDefaultAppearance.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,7 @@ This file is part of the iText (R) project.
4343
package com.itextpdf.kernel.pdf.annot.da;
4444

4545
import com.itextpdf.io.font.FontConstants;
46+
import com.itextpdf.io.util.MessageFormatUtil;
4647
import com.itextpdf.kernel.color.DeviceCmyk;
4748
import com.itextpdf.kernel.color.DeviceGray;
4849
import com.itextpdf.kernel.color.DeviceRgb;
@@ -127,14 +128,13 @@ public AnnotationDefaultAppearance setColor(DeviceGray grayColor) {
127128
}
128129

129130
public PdfString toPdfString() {
130-
return new PdfString(rawFontName + " " + fontSize + " Tf " + colorOperand);
131+
return new PdfString(MessageFormatUtil.format("{0} {1} Tf {2}", rawFontName, fontSize, colorOperand));
131132
}
132133

133134
private void setColorOperand(float[] colorValues, String operand) {
134135
StringBuilder builder = new StringBuilder();
135136
for (float value : colorValues) {
136-
builder.append(value);
137-
builder.append(' ');
137+
builder.append(MessageFormatUtil.format("{0} ", value));
138138
}
139139
builder.append(operand);
140140
this.colorOperand = builder.toString();

0 commit comments

Comments
 (0)