Man, the answer was pertinent if you knew how to listen. You can use a
TextField, there's even a FieldPositioningEvents to help. There are
examples about using TextField in the book and there's even an example
in the tutorial about placing TextField in a PdfPCell using
PdfPCellEvent. A mailing list exists to point people to the right way,
not to have concearns about your urgency or to do your work. 

Paulo 

> -----Original Message-----
> From: [EMAIL PROTECTED] 
> [mailto:[EMAIL PROTECTED] On 
> Behalf Of razvanb
> Sent: Monday, April 14, 2008 10:31 AM
> To: itext-questions@lists.sourceforge.net
> Subject: Re: [iText-questions] PdfFormfield textfield background color
> 
> 
> Man, your reply was to no use...if you can give a pertinent 
> answer ok...if
> not...
> 
> razvanb wrote:
> > 
> > Hi!
> > I have an urgent problem! 
> > 
> > I made a form that has many textfields created with the method
> > PdfFormField.createTextField(PdfWriter writer, boolean 
> multiline, boolean
> > password, int maxLen), and that because my textfields are in
> > PdfPCell(table cells).
> > My problem is that i want these textfields to have a Green 
> background
> > color(in general, not only when focused), and all that i 
> managed to do was
> > to set the backgroundcolor only when you focus that textfield(with
> > setMKBackgroundColor(Color)).
> > 
> > So please...if anyone knows how this can be done...it would 
> be of a great
> > help!
> > 
> > Please notice that I'm not using the class Textfield, but 
> PdfFormField,
> > and this is because with TextField i do not know how to insert the
> > textfield in a specific cell of a table.
> > 
> > Any solutions are good....!
> > 
> > Here is a part of the code:
> > 
> > PdfPTable nested2 = new PdfPTable(2);
> > cell = new PdfPCell();
> >             form = PdfFormField.createTextField(writer, 
> false, false, 20);
> >             form.setFieldName("AbrufNr");
> >             form.setMKBackgroundColor(Color.LIGHT_GRAY);
> >             writer.addAnnotation(form);
> >             cell.setCellEvent(new TestMain(form, 1f, 
> "textfieldAbrufNr"));
> >             cell.setBorder(PdfPCell.NO_BORDER);
> >             cell.setGrayFill(0.9f);
> >             nested2.addCell(cell);
> > 
> > -----------------------
> > public void cellLayout(PdfPCell cell, Rectangle rect, 
> PdfContentByte[] cb)
> > {
> > if(formType.equalsIgnoreCase("textfieldAbrufNr")){
> >             form.setWidget(new Rectangle(rect.getLeft(padding),
> > rect.getBottom(padding),
> >                             rect.getLeft(padding) + 20, 
> rect.getBottom(padding) + 10),
> >                             PdfAnnotation.HIGHLIGHT_INVERT);
> >         }
> > }
> > -----------------------
> > The class TestMain implements PdfPCellEvent; So this method 
> cellLayout is
> > executed at the end...setting the position of my textfield 
> in the cell!


Aviso Legal:
Esta mensagem é destinada exclusivamente ao destinatário. Pode conter 
informação confidencial ou legalmente protegida. A incorrecta transmissão desta 
mensagem não significa a perca de confidencialidade. Se esta mensagem for 
recebida por engano, por favor envie-a de volta para o remetente e apague-a do 
seu sistema de imediato. É proibido a qualquer pessoa que não o destinatário de 
usar, revelar ou distribuir qualquer parte desta mensagem. 

Disclaimer:
This message is destined exclusively to the intended receiver. It may contain 
confidential or legally protected information. The incorrect transmission of 
this message does not mean the loss of its confidentiality. If this message is 
received by mistake, please send it back to the sender and delete it from your 
system immediately. It is forbidden to any person who is not the intended 
receiver to use, distribute or copy any part of this message.


-------------------------------------------------------------------------
This SF.net email is sponsored by the 2008 JavaOne(SM) Conference 
Don't miss this year's exciting event. There's still time to save $100. 
Use priority code J8TL2D2. 
http://ad.doubleclick.net/clk;198757673;13503038;p?http://java.sun.com/javaone
_______________________________________________
iText-questions mailing list
iText-questions@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/itext-questions

Do you like iText?
Buy the iText book: http://www.1t3xt.com/docs/book.php
Or leave a tip: https://tipit.to/itexttipjar

Reply via email to