protected override void Draw(PdfContentByte cb)
{
//TODO if width and height not know: what to do
//PdfTemplate template = cb.CreateTemplate(this.width, this.height);
PdfTemplate template = cb.CreateTemplate(500, 500);
//draw the list of elements on the new template
foreach (IElement elem in this.list)
{
Graphic graphic = (Graphic)elem;
if (applyCSSToElements)
{
graphic.Draw(template, GetCombinedCss(graphic.GetCss(), GetCss()));
}
else
{
graphic.Draw(template, graphic.GetCss());
}
}
//add the template at the x, y position
System.Drawing.Drawing2D.Matrix translation = new System.Drawing.Drawing2D.Matrix();
translation.Translate(this.x, this.y);
cb.ConcatCTM(translation);
cb.Add(template);
}