hi,

I have created a formfield button and set all the attributes. I want the button to appear with a simple rectangle outline. I used the code below:

PdfFormField oFormField = PdfFormField.createPushButton(m_oWriter);
oFormField.setWidget(new Rectangle(100, 700, 180, 720), PdfAnnotation.HIGHLIGHT_INVERT);
oFormField.setFieldName(oButton.getName());
oFormField.setMKBorderColor(Color.BLACK);
oFormField.setMKBackgroundColor(Color.WHITE);
oFormField.setMKNormalCaption(oButton.getTitle());
PdfContentByte oContentByte = m_oWriter.getDirectContent();
PdfAppearance oAppearance = oContentByte.createAppearance(80,20);
oFormField.setAppearance(PdfAnnotation.APPEARANCE_NORMAL, oAppearance);


But with this code the button is not visible. If I take the FormTool and then click its OK, then the button's appearance comes. I tried setting my own appearance through code, but still when I invoke the Form Tool, the same behaviour happens. Is there any way that I can set the appearance of the button to the same appearance as when the FormTool's OK is clicked.

Hope I have explained the problem well.
Any help is appreciated.

Thank You

Regards,
Annu



-------------------------------------------------------
This SF.Net email is sponsored by: IntelliVIEW -- Interactive Reporting
Tool for open source databases. Create drag-&-drop reports. Save time
by over 75%! Publish reports on the web. Export to DOC, XLS, RTF, etc.
Download a FREE copy at http://www.intelliview.com/go/osdn_nl
_______________________________________________
iText-questions mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/itext-questions

Reply via email to