C1PrintDocument doc = new C1PrintDocument(); RenderArea ra = new RenderArea(); ra.ObjectResolvedScript = "if RenderObject.Fragments.Count > 1 then\r\n" + "RenderObject.Style.BackColor = Color.Red\r\n" + "else\r\n" + "RenderObject.Style.BackColor = Color.Green\r\n" + "end if\r\n"; ra.Style.Borders.All = LineDef.DefaultBold; // ... fill ra with sample content: for (int i = 0; i < 30; i++) ra.Children.Add(new RenderText("Line " + i.ToString())); doc.Body.Children.Add(ra);
Note that while you can adjust any style properties on the object, the size and position of the object will not be re-calculated even if a property affecting it (such as font size) changes (so, for instance, if the font size is increased, clipping may occur). Basically, this means that normally only properties that do not affect the object's layout (such as text and background colors) should be changed in this script.