Kristof Taveirne wrote:
> I've tried to insert code like it is mentioned in the book in chapter 15:
> TextField tf1 =
> new TextField(writer, new Rectangle(40, 720, 360, 750), "fox");
> tf1.setBackgroundColor(Color.YELLOW);
> tf1.setBorderColor(Color.RED);
> tf1.setBorderWidth(2);
> tf1.setBorderStyle(PdfBorderDictionary.STYLE_BEVELED);
> tf1.setText("Quick brown fox jumps over the lazy dog");
> tf1.setAlignment(Element.ALIGN_CENTER);
> tf1.setOptions(TextField.REQUIRED);
> writer.addAnnotation(tf1.getTextField());
> 
> But this doesn't work at all, I don't find a trace ot this text field
> in the resulting PDF.

What do you mean by "this doesn't work at all"?
Have you looked at the area you defined with the
coordinates (40, 720), (360, 750)? I mean: you say
you want the TextField to be added at some position,
then you arbitrarily chose some coordinates.

What do you mean by "I don't find a trace of this
text field in the resulting PDF"? Have you opened
the PDF in a text editor and found out there is no
AcroForm? Have you looked at the PDF in an analyzing
tool such as RUPS and seen there is no form present?

Personally, I'd add the TextField in a cell event.
The cell event passes the writer and the necessary
coordinates. You refer to the book: do the examples
that come with the book work for you?
-- 
This answer is provided by 1T3XT BVBA

-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________
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/

Reply via email to