|
1 | 1 | package com.itextpdf.forms.fields;
|
2 | 2 |
|
3 |
| -import com.itextpdf.core.PdfException; |
4 | 3 | import com.itextpdf.basics.codec.Base64;
|
5 | 4 | import com.itextpdf.basics.font.FontConstants;
|
6 | 5 | import com.itextpdf.basics.font.PdfEncodings;
|
7 |
| -import com.itextpdf.core.geom.Rectangle; |
8 | 6 | import com.itextpdf.basics.image.Image;
|
9 | 7 | import com.itextpdf.basics.image.ImageFactory;
|
10 | 8 | import com.itextpdf.basics.source.PdfTokenizer;
|
11 | 9 | import com.itextpdf.basics.source.RandomAccessFileOrArray;
|
12 | 10 | import com.itextpdf.basics.source.RandomAccessSourceFactory;
|
| 11 | +import com.itextpdf.core.PdfException; |
13 | 12 | import com.itextpdf.core.color.Color;
|
14 | 13 | import com.itextpdf.core.color.DeviceCmyk;
|
15 | 14 | import com.itextpdf.core.color.DeviceGray;
|
16 | 15 | import com.itextpdf.core.color.DeviceRgb;
|
17 | 16 | import com.itextpdf.core.font.PdfFont;
|
18 | 17 | import com.itextpdf.core.font.PdfFontFactory;
|
| 18 | +import com.itextpdf.core.geom.Rectangle; |
19 | 19 | import com.itextpdf.core.pdf.PdfArray;
|
20 | 20 | import com.itextpdf.core.pdf.PdfDictionary;
|
21 | 21 | import com.itextpdf.core.pdf.PdfDocument;
|
@@ -229,9 +229,9 @@ public static PdfTextFormField createText(PdfDocument doc, Rectangle rect) {
|
229 | 229 | * value, and the form's default font specified in
|
230 | 230 | * {@link com.itextpdf.forms.PdfAcroForm#getDefaultResources}.
|
231 | 231 | *
|
232 |
| - * @param doc the {@link PdfDocument} to create the text field in |
233 |
| - * @param rect the location on the page for the text field |
234 |
| - * @param name the name of the form field |
| 232 | + * @param doc the {@link PdfDocument} to create the text field in |
| 233 | + * @param rect the location on the page for the text field |
| 234 | + * @param name the name of the form field |
235 | 235 | * @return a new {@link PdfTextFormField}
|
236 | 236 | */
|
237 | 237 | public static PdfTextFormField createText(PdfDocument doc, Rectangle rect, String name) {
|
@@ -277,13 +277,13 @@ public static PdfTextFormField createText(PdfDocument doc, Rectangle rect, Strin
|
277 | 277 | * Creates a named {@link PdfTextFormField text form field} with an initial
|
278 | 278 | * value, with a specified font and font size.
|
279 | 279 | *
|
280 |
| - * @param doc the {@link PdfDocument} to create the text field in |
281 |
| - * @param rect the location on the page for the text field |
282 |
| - * @param name the name of the form field |
283 |
| - * @param value the initial value |
284 |
| - * @param font a {@link PdfFont} |
285 |
| - * @param fontSize a positive integer |
286 |
| - * @param multiline true for multiline text field |
| 280 | + * @param doc the {@link PdfDocument} to create the text field in |
| 281 | + * @param rect the location on the page for the text field |
| 282 | + * @param name the name of the form field |
| 283 | + * @param value the initial value |
| 284 | + * @param font a {@link PdfFont} |
| 285 | + * @param fontSize a positive integer |
| 286 | + * @param multiline true for multiline text field |
287 | 287 | * @return a new {@link PdfTextFormField}
|
288 | 288 | */
|
289 | 289 | public static PdfTextFormField createText(PdfDocument doc, Rectangle rect, String name, String value, PdfFont font, int fontSize, boolean multiline) {
|
@@ -1344,6 +1344,8 @@ public <T extends PdfFormField> T setAction(PdfAction action) {
|
1344 | 1344 |
|
1345 | 1345 | /**
|
1346 | 1346 | * Changes the type of graphical marker used to mark a checkbox as 'on'.
|
| 1347 | + * Notice that in order to complete the change one should call |
| 1348 | + * {@link #regenerateField() regenerateField} method |
1347 | 1349 | *
|
1348 | 1350 | * @param checkType the new checkbox marker
|
1349 | 1351 | */
|
@@ -2162,7 +2164,7 @@ protected void drawCheckBox(PdfCanvas canvas, float width, float height, int fon
|
2162 | 2164 | beginText().
|
2163 | 2165 | setFontAndSize(ufont, fontSize).
|
2164 | 2166 | resetFillColorRgb().
|
2165 |
| - setTextMatrix((width - ufont.getWidth(text, fontSize)) / 2, (height - ufont.getAscent(text, fontSize) ) / 2). |
| 2167 | + setTextMatrix((width - ufont.getWidth(text, fontSize)) / 2, (height - ufont.getAscent(text, fontSize)) / 2). |
2166 | 2168 | showText(text).
|
2167 | 2169 | endText();
|
2168 | 2170 | }
|
|
0 commit comments