You have forgottern to add this 
      template .*stroke();  *
 *after drowing circle   *template.*circle(25f, 25f, 25);*

This this example, it works correcly:

PdfPTable table = new PdfPTable(2);
table.setTotalWidth(300);

PdfContentByte canvas = pdfWriter.getDirectContent();
PdfTemplate template = canvas .createTemplate(50, 50);
template .setLineWidth(1.5f);
template.circle(25f, 25f, 25);
template .stroke();

Image img = Image.getInstance(template);        
Phrase phrase = new Phrase(new Chunk(img, 1f, 1f));
PdfPCell cell = new PdfPCell(phrase);
table.addCell(cell);

// If you find such kind of example with use  cell.addElement(chunk);
// do not use that, the circle will not be included correctly in the cell.  
Chunk chunk = new Chunk(img, 1f, 1f);
PdfPCell cell2 = new PdfPCell();
cell2.addElement(chunk);
table.addCell(cell2);


This is the result :
<http://itext-general.2136553.n4.nabble.com/file/n4659517/cells.png> 



--
View this message in context: 
http://itext-general.2136553.n4.nabble.com/Problems-drawing-in-a-PdfPCell-tp3237857p4659517.html
Sent from the iText - General mailing list archive at Nabble.com.

------------------------------------------------------------------------------
Rapidly troubleshoot problems before they affect your business. Most IT 
organizations don't have a clear picture of how application performance 
affects their revenue. With AppDynamics, you get 100% visibility into your 
Java,.NET, & PHP application. Start your 15-day FREE TRIAL of AppDynamics Pro!
http://pubads.g.doubleclick.net/gampad/clk?id=84349351&iu=/4140/ostg.clktrk
_______________________________________________
iText-questions mailing list
iText-questions@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/itext-questions

iText(R) is a registered trademark of 1T3XT BVBA.
Many questions posted to this list can (and will) be answered with a reference 
to the iText book: http://www.itextpdf.com/book/
Please check the keywords list before you ask for examples: 
http://itextpdf.com/themes/keywords.php

Reply via email to