Hi list,
According to the examples in the book, when creating a PDF form,
setting the default color of the text of a field is simple:
/* chapter15/Buttons2.java */
PushbuttonField push = new PushbuttonField(writer,
new Rectangle(40, 650, 150, 680), "pushAction");
push.setBackgroundColor(Color.YELLOW);
push.setBorderColor(Color.BLACK);
push.setText("Push");
push.setTextColor(Color.RED); /* THIS IS THE WAY */
push.setTemplate(template);
push.setScaleIcon(PushbuttonField.SCALE_ICON_ALWAYS);
push.setLayout(PushbuttonField.LAYOUT_ICON_LEFT_LABEL_RIGHT);
PdfFormField pushbutton = push.getField();
pushbutton.setAction(
PdfAction.javaScript("this.showButtonState()", writer));
writer.addAnnotation(pushbutton);
But what about changing the color of the text of a field when opening
an existing PDF? Should I get a compatible BaseField object
representing the field I intentd to change? If so, how could I do
that?
I need this because I want to put in red the fields in one acroform
wich are not validated
thanks for your time.
-------------------------------------------------------------------------
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
_______________________________________________
iText-questions mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/itext-questions
Buy the iText book: http://itext.ugent.be/itext-in-action/