Copy the source of FieldPositioningEvents and change it to your needs.

Paulo

> -----Original Message-----
> From: [EMAIL PROTECTED] 
> [mailto:[EMAIL PROTECTED] On 
> Behalf Of Jon Galentine
> Sent: Wednesday, November 15, 2006 4:41 PM
> To: [email protected]
> Subject: Re: [iText-questions] Formfield Placement Within Nested Table
> 
> An update on this...when using relative widths the cell 
> alignment is correct however this causes the form field to 
> stretch which is not the desired effect.  Any help on this 
> would be greatly appreciated.
> 
>  
> 
> ________________________________
> 
> From: Jon Galentine 
> Sent: Tuesday, November 14, 2006 9:43 AM
> To: '[email protected]'
> Subject: Formfield Placement Within Nested Table
> 
>  
> 
> I am attempting to add a RadioCheckField to a PdfPTable which 
> is then added as a nested table within another PdfPTable.  
> The table that contains the RadioCheckField also houses a 
> Chuck object representing the label of the RadioCheckField.  
> I have successfully created the RadioCheckField cell with a 
> fixed width however the placement of the cell within the 
> encasing table seems incorrect.  I've listed the code I am 
> using and have additionally attached a screen print of the 
> output.  As the screen print indicates the RadioCheckField 
> for the Gender field is added to the middle of the table 
> cell.  I am unable to determine why the cell would not align 
> to the left, which is the stated default behavior.  Any 
> assistance on this would be greatly appreciated.  
> 
>  
> 
> Table Creation:
> 
>  
> 
> float[] colWidths = {20f, 55f};
> 
> fieldTable.setWidths(colWidths);    
> 
> fieldTable.setTotalWidth(75f);
> 
> fieldTable.setLockedWidth(true);
> 
>                     
> 
> fieldCell.setCellEvent(new FieldPositioningEvents(writer,
> 
>                             createRadioButton(inputTag)));
> 
>  
> 
> fieldTable.addCell(fieldCell);
> 
> fieldTable.addCell(labelCell);
> 
>  
> 
>  
> 
> Pertinent lines within the createRadioButton() method:
> 
>  
> 
> RadioCheckField bt = new RadioCheckField(writer,
> 
>                     new Rectangle(0, 0, 3, 3), idAtt+ 
> (Math.random() * 100), value);
> 
>             bt.setCheckType(RadioCheckField.TYPE_CIRCLE);
> 
>             bt.setBox(new Rectangle(0, 0, 3, 3));
> 
>             bt.setBackgroundColor(Color.white);                    
> 
>             if ("checked".equalsIgnoreCase(checkedAtt)) {
> 
>                 bt.setChecked(true);
> 
>             } else {
> 
>                 bt.setChecked(false);
> 
>             }
> 
>             
> 
>             ck = bt.getCheckField();
> 
>  
> 
> The table containing the formfield and label is added to its 
> parent table with the following code:
> 
>  
> 
> pTable.addCell((PdfPTable) ret);
> 
>  
> 
> The parent table is then added to the document via the 
> document.add() method.
> 
>  
> 
> Thanks,
> 
>  
> 
> Jon Galentine
> 
> Pharmanet, Inc.
> 
> 1001 Winstead Drive Suite 505
> 
> Cary, NC 27513
> 
>  
> 
> Phone: 919-388-4002
> 
> Fax: 919-678-0395
> 
> email: [EMAIL PROTECTED] <mailto:[EMAIL PROTECTED]> 
> 
>  
> 
> 


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.


-------------------------------------------------------------------------
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
Buy the iText book: http://itext.ugent.be/itext-in-action/

Reply via email to