If you include an appearance it's your responsability for the design of the appearance. oContentByte.createAppearance(80,20) will get you an empty appearance, you'll have to draw something inside it.
> -----Original Message----- > From: [EMAIL PROTECTED] > [mailto:[EMAIL PROTECTED] On > Behalf Of Annu Ittyachen Mathew > Sent: Tuesday, February 01, 2005 10:28 AM > To: [email protected] > Subject: [iText-questions] Problem creating a PdfFormButton > > 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 > ------------------------------------------------------- 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
