Hi to all another time :-D.

  Well, now i write to say than I'll find what was my problem with check
boxes. All my problem was that I created a chunk with an empty string. This
makes than the library cannot draw the control on the document. The solution
was to create the chunk with a string that have some blank spaces.

  Thanks for all.

 
<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
________________________________________
De: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] En nombre de Juan
Carrasco
Enviado el: jueves, 03 de agosto de 2006 14:23
Para: 'Lista iText'
Asunto: [iText-questions] PDF Form fields with relative position.

  Hi to all. 
  I’m trying to create form field in a PDF using iText. But I don’t know the
absolute position of this fields on the final document nor in the final
page. I find a way to add Text Fields to a document relatively to the text
added to it, but now I need to do the same with CheckBox, Radio Button, List
and Combos.

  To add Text Fields relatively to a text, I create a Chunk and asociate
text field to the Chunk’s annotation, following this : Chunk.setAnnotation
(annotation). This works, but when I tried the same way with check boxes,
the controls do not appear on the PDF.

  Here is the source code than I try:

nuevo_elemento = new Chunk (“”); 
                                                                  // Chunk
to set the relative position of the Check Box.

            PdfFormField check1 = PdfFormField.createCheckBox(escritor);
            Rectangle rect = new Rectangle(0, 0, 20, 20); 
                                                  // Position to set the
widget
            check1.setFieldName("tarjetaCredito");
            check1.setValueAsName("Off");
            check1.setWidget(rect, PdfAnnotation.HIGHLIGHT_INVERT);
            check1.setAppearanceState("Off");
            check1.setAppearance(PdfAnnotation.APPEARANCE_NORMAL, "Off",
tpOff2);
            check1.setAppearance(PdfAnnotation.APPEARANCE_NORMAL, "On",
tpOn2);
           
nuevo_elemento.setAnnotation(check1);                                       
                     // Associate Check Box (check1) with his content Chunk
(nuevo_elemento)
            doc.add (nuevo_elemento);


__________ Informacisn de NOD32, revisisn 1.1422 (20060301) __________

Este mensaje ha sido analizado con NOD32 antivirus system
http://www.nod32.com

>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>


-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys -- and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
iText-questions mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/itext-questions

Reply via email to