That's too much code. Post just a small standalone example. It wouldn't
hurt to post the resulting PDF and what you'd expect to happen.

Paulo 

> -----Original Message-----
> From: [EMAIL PROTECTED] 
> [mailto:[EMAIL PROTECTED] On 
> Behalf Of Bill Taggart
> Sent: Friday, January 12, 2007 5:42 PM
> To: [email protected]
> Subject: [iText-questions] Underline Not Consistently Working 
> in PdfPTable
> 
> The Chunk setUnderline is not consistently working when used 
> in a PdfPTable.
> 
> If these Chunks are simply added to the document, they work fine.
> 
> I have flagged the setUnderline instances that are failing 
> with a line before 
> them entitled "// -- THE NEXT LINE IS NOT WORKING".
> 
> Here is the code:
> 
>               PdfPTable spouseContentTable = new PdfPTable(1);
>               spouseContentTable.setWidthPercentage(100);
>               spouseContentTable.setHorizontalAlignment(0);
>               spouseContentTable.setSpacingBefore(30);
>               spouseContentTable.setKeepTogether(true);
>               
>               PdfPCell cell = null;
>               
>               Chunk spouseSectionPart1 = new Chunk("3", 
> FontFactory.getFont
> (FontFactory.HELVETICA, 26, Font.BOLD));
>               Chunk spouseSectionPart2 = new Chunk("  Consent 
> of Spouse", 
> FontFactory.getFont(FontFactory.HELVETICA, 16, Font.BOLD));
>               Paragraph spouseParagraph = new Paragraph();
>               spouseParagraph.add(spouseSectionPart1);
>               spouseParagraph.add(spouseSectionPart2);
>               cell = new PdfPCell(spouseParagraph);
>               cell.setBorder(0);
>               spouseContentTable.addCell(cell);
>               
>               cell = new PdfPCell(new Paragraph(
>                               "I, the spouse of "
>                               + theParticipant
>                                               
> .getFirstNameMiddleNameLastName
> ()
>                               + ", certify that I have read 
> this designation 
> of beneficiaries. I hereby consent to the above designations 
> and understand 
> their effect; namely, that they may modify, reduce or 
> eliminate any benefits I 
> may otherwise have received under the plan in the event of my 
> spouse's death. I 
> further understand that my consent to such designation is 
> irrevocable unless my 
> spouse files a new Designation of Beneficiaries Form with the plan 
> administrator.",
>               FontFactory.getFont(FontFactory.TIMES_ROMAN, 12)));
>               cell.setBorder(0);
>               cell.setLeading(1f,1.5f);
>               cell.setPaddingTop(10f);
>               spouseContentTable.addCell(cell);
>               
>               Phrase spouseXLine = new Phrase();
>               String spouseUnderlineText1 
> = "                                                                 ";
>               Chunk spouseUnderline1 = new 
> Chunk(spouseUnderlineText1.replace
> (' ', '\u0020')
>               , FontFactory.getFont(FontFactory.TIMES_ROMAN, 12));
>               spouseUnderline1.setUnderline(0.2f, -2f);
>               spouseXLine.add(spouseUnderline1);
>               String spouseXText = "  X";
>               spouseXLine.add(new Chunk(spouseXText.replace(' 
> ', '\u0020'), 
> FontFactory.getFont(FontFactory.TIMES_ROMAN, 12)));
>               String spouseUnderlineText2 
> = "                                                            ";
>               Chunk spouseUnderline2 = new Chunk(
>                       spouseUnderlineText2.replace(' ', '\u0020'), 
> FontFactory.getFont(FontFactory.TIMES_ROMAN, 12));
> // -- THE NEXT LINE IS NOT WORKING
>               spouseUnderline2.setUnderline(0.2f, -2f);
>               spouseXLine.add(spouseUnderline2);
>               String spouseXText2 = "     ";
>               spouseXLine.add(new 
> Chunk(spouseXText2.replace(' ', '\u0020'), 
> FontFactory.getFont(
>                               FontFactory.TIMES_ROMAN, 12)));
>               String spouseUnderlineText3 = "                    ";
>               Chunk spouseUnderline3 = new 
> Chunk(spouseUnderlineText3.replace
> (' ', '\u0020'), FontFactory.getFont(FontFactory.TIMES_ROMAN, 12));
> // -- THE NEXT LINE IS NOT WORKING
>               spouseUnderline3.setUnderline(0.2f, -2f);
>               spouseXLine.add(spouseUnderline3);
>               cell = new PdfPCell(spouseXLine);
>               cell.setBorder(0);
>               cell.setPaddingTop(20f);
>               spouseContentTable.addCell(cell);
> 
>               Paragraph spouseTextLine = new Paragraph();
>               Chunk underlineText1 = new Chunk("Spouse's name 
> (please print)",
>                               
> FontFactory.getFont(FontFactory.TIMES_ROMAN, 
> 11, Font.ITALIC));
>               spouseTextLine.add(underlineText1);
>               spouseTextLine.add(new Chunk
> ("                               "));
>               Chunk underlineText2 = new Chunk("Spouse's signature", 
> FontFactory
>                               .getFont(FontFactory.TIMES_ROMAN, 11, 
> Font.ITALIC));
>               spouseTextLine.add(underlineText2);
>               spouseTextLine.add(new Chunk
> ("                                        "));
>               Chunk underlineText3 = new Chunk("Date", 
> FontFactory.getFont(
>                               FontFactory.TIMES_ROMAN, 11, 
> Font.ITALIC));
>               spouseTextLine.add(underlineText3);
>               cell = new PdfPCell(spouseTextLine);
>               cell.setBorder(0);
>               cell.setPaddingTop(10f);
>               spouseContentTable.addCell(cell);
> 
>               Paragraph spouseAcknowledgeText = new Paragraph();
>               spouseAcknowledgeText.add(new Chunk("Acknowledgment", 
> FontFactory
>                               .getFont(FontFactory.HELVETICA, 16, 
> Font.BOLD)));
>               spouseAcknowledgeText.add(new Chunk(
>                               " (Spouse's signature must be 
> acknowledged by a 
> notary public.)",
>                               
> FontFactory.getFont(FontFactory.TIMES_ROMAN, 12,
>                                               Font.ITALIC)));
>               cell = new PdfPCell(spouseAcknowledgeText);
>               cell.setBorder(0);
>               cell.setPaddingTop(30f);
>               spouseContentTable.addCell(cell);
>               
>               Paragraph spouseAcknowledgeState = new Paragraph();
>               spouseAcknowledgeState.add(new Chunk("State of ", 
> FontFactory.getFont(
>                               FontFactory.TIMES_ROMAN, 12)));
>               Chunk underlineAcknowledgment1 = new Chunk(
>               "                              ");
>               underlineAcknowledgment1.setUnderline(0.2f, -2f);
>               spouseAcknowledgeState.add(underlineAcknowledgment1);
>               spouseAcknowledgeState.add(new Chunk("  County of ", 
> FontFactory.getFont(
>                               FontFactory.TIMES_ROMAN, 12)));
>               
>               Chunk underlineAcknowledgment2 = new Chunk(
>               "                                           ");
> // -- THE NEXT LINE IS NOT WORKING
>               underlineAcknowledgment2.setUnderline(0.2f, -2f);
>               spouseAcknowledgeState.add(underlineAcknowledgment2);
>               
>               cell = new PdfPCell(spouseAcknowledgeState);
>               cell.setBorder(0);
>               cell.setPaddingTop(20f);
>               spouseContentTable.addCell(cell);
> 
>               Paragraph acknowledgmentParagraph = new Paragraph();
>               acknowledgmentParagraph.add(new Chunk("On this ", 
> FontFactory.getFont(
>                               FontFactory.TIMES_ROMAN, 12)));
>               Chunk acknowledgmentParagrgaphUnderline1 = new Chunk
> ("        ");
>               
> acknowledgmentParagrgaphUnderline1.setUnderline(0.2f, -2f);
>               
> acknowledgmentParagraph.add(acknowledgmentParagrgaphUnderline1);
>               acknowledgmentParagraph.add(new Chunk(" day of ", 
> FontFactory.getFont(
>                               FontFactory.TIMES_ROMAN, 12)));
>               Chunk acknowledgmentParagrgaphUnderline2 = new Chunk(
>                               "                        ");
>               
> acknowledgmentParagrgaphUnderline2.setUnderline(0.2f, -2f);
>               
> acknowledgmentParagraph.add(acknowledgmentParagrgaphUnderline2);
>               acknowledgmentParagraph.add(new Chunk(", ", 
> FontFactory.getFont(
>                               FontFactory.TIMES_ROMAN, 12)));
>               Chunk acknowledgmentParagrgaphUnderline3 = new Chunk(
>                               "                 ");
>               
> acknowledgmentParagrgaphUnderline3.setUnderline(0.2f, -2f);
>               
> acknowledgmentParagraph.add(acknowledgmentParagrgaphUnderline3);
>               acknowledgmentParagraph
>                               .add(new Chunk(
>                                               " there 
> appeared before me in 
> person, the person whose signature appears above, the spouse of the 
> participant, to me personally known to be the person who 
> executed the foregoing 
> consent and acknowledged to me that (s)he executed the same 
> as his or her own 
> free act and deed and for the purpose therein stated.",
>                                               FontFactory.getFont
> (FontFactory.TIMES_ROMAN, 12)));
>               cell = new PdfPCell(acknowledgmentParagraph);
>               cell.setBorder(0);
>               cell.setLeading(1f,1.5f);
>               cell.setPaddingTop(20f);
>               spouseContentTable.addCell(cell);
> 
>               Paragraph spouseAcknowledgeXLine = new Paragraph();
>               spouseAcknowledgeXLine.add(new Chunk("X ", 
> FontFactory.getFont(
>                               FontFactory.TIMES_ROMAN, 12)));
>               Chunk acknowledgmentUnderline1 = new Chunk(
>               "                                               
>             ");
> // -- THE NEXT LINE IS NOT WORKING
>               acknowledgmentUnderline1.setUnderline(0.2f, -2f);
>               spouseAcknowledgeXLine.add(acknowledgmentUnderline1);
>               spouseAcknowledgeXLine.add(new Chunk(
>                       
>       "                                               ", FontFactory
>                                               .getFont
> (FontFactory.TIMES_ROMAN, 12)));
>               Chunk acknowledgmentUnderline3 = new Chunk(
>               "                                     ");
> // -- THE NEXT LINE IS NOT WORKING
>               acknowledgmentUnderline3.setUnderline(0.2f, -2f);
>               spouseAcknowledgeXLine.add(acknowledgmentUnderline3);
>               cell = new PdfPCell(spouseAcknowledgeXLine);
>               cell.setBorder(0);
>               cell.setPaddingTop(20f);
>               spouseContentTable.addCell(cell);
>               
>               Paragraph spouseAcknowledgeTextLine = new Paragraph();
>               Chunk acknowledgmentUnderlineText1 = new Chunk(
>                               "   Signature of notary public", 
> FontFactory.getFont(
>                                               
> FontFactory.TIMES_ROMAN, 11, 
> Font.ITALIC));
>               
> spouseAcknowledgeTextLine.add(acknowledgmentUnderlineText1);
>               spouseAcknowledgeTextLine.add(new Chunk
> ("                                "));
>               Chunk acknowledgmentUnderlineText2 = new 
> Chunk("(Seal)", 
> FontFactory
>                               .getFont(FontFactory.TIMES_ROMAN, 11, 
> Font.BOLD));
>               
> spouseAcknowledgeTextLine.add(acknowledgmentUnderlineText2);
>               spouseAcknowledgeTextLine.add(new Chunk
> ("                           "));
>               Chunk acknowledgmentUnderlineText3 = new Chunk(
>                               "Commission expiration date", 
> FontFactory.getFont(
>                                               
> FontFactory.TIMES_ROMAN, 11, 
> Font.ITALIC));
>               
> spouseAcknowledgeTextLine.add(acknowledgmentUnderlineText3);
>               cell = new PdfPCell(spouseAcknowledgeTextLine);
>               cell.setBorder(0);
>               cell.setPaddingTop(10f);
>               spouseContentTable.addCell(cell);
>               
>               document.add(spouseContentTable);
> 
> Thanks!
> 
> 
> 
> --------------------------------------------------------------
> -----------
> 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/
> 


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