Hi everyone,

I have a question with using PdfPCellEvent.  I have a class that implements this interface like this.
class CrossEvent implements PdfPCellEvent
{
    public void cellLayout(PdfPCell cell, Rectangle position, PdfContentByte[] canvases) {
        PdfContentByte cb = canvases[PdfPTable.TEXTCANVAS];
        cb.setColorStroke(new Color(209, 209, 209));
        cb.moveTo(position.left(), position.bottom());
        cb.lineTo(position.right(), position.top ());
        cb.stroke();
        cb.moveTo(position.left(), position.top());
        cb.lineTo(position.right(), position.bottom());
        cb.stroke();
    }
}
This draws an 'X' in a table cell. 

I then create a PdfPCell like this:

CrossEvent event = new CrossEvent();
Paragraph text = new Paragraph(simplified[i], fontChinese);
PdfPCell cell = new PdfPCell(text);
cell.setCellEvent(event);
...

What's happening now is that it seem to draw the text from the paragraph first, and then draw the 'X' over the text.  Is it possible to draw the 'X' first and put the text on top?

Thanks
Chris

Reply via email to