Good morning.
I am creating a PDF with ItextSharp 5.5.10 and in it I have to include texts with a white background in certain positions. The PDF page contains a background image. For this I am using PdfContentByte but I can not get my white background painted.
PdfContentByte cb = writer.DirectContent;
cb.BeginText();
cb.SetTextMatrix(cuadroTexto.PosX, defaultHeight - (cuadroTexto.PosY + cuadroTexto.Alto));
Font font = FontFactory.GetFont(FontFactory.HELVETICA, 8.25f, BaseColor.BLACK);
cb.SetFontAndSize(font.BaseFont, 8.25f);
cb.ShowText(cuadroTexto.Texto);
cb.SetColorFill(BaseColor.WHITE); // Aqui intento ponerle el blanco pero lo ignora
cb.EndText();
Is there any way to do it with PdfContentByte or do I have to resort to painting a white regtanger by hand?
PS: In case it works I'm using Visual Studio 2013 Express
UPDATE 1
I have tried with cb.Fill();
as recommended below and still not colored.