// ---------------------------------------------------------------------------
/**
* Prints a square and fills half of it with a gray rectangle.
*
* @param x
* @param y
* @param cb
* @throws Exception
*/
public static void PictureBackdrop(float x, float y, PdfContentByte cb,
PdfWriter writer)
{
PdfShading axial = PdfShading.SimpleAxial(writer, x, y, x + 200, y,
BaseColor.YELLOW, BaseColor.RED
);
PdfShadingPattern axialPattern = new PdfShadingPattern(axial);
cb.SetShadingFill(axialPattern);
cb.SetColorStroke(BaseColor.BLACK);
cb.SetLineWidth(2);
cb.Rectangle(x, y, 200, 200);
cb.FillStroke();
}