Can i get some example of the usage of the IBlockElement Split() function.
Regards,
Sandeep
1 Answer, 1 is accepted
0
Deyan
Telerik team
answered on 02 Dec 2014, 04:43 PM
Hello Sandeep,
Thank you for contacting us.
The IBlockElement interface is designed to be used in the following scenario:
Measure some block element in a desired size.
Draw the element in the desired size and position.
Split the element when there is any pending content that needs to be drawn.
The following code snippet shows how to split some long text and draw its parts one below the other. The code uses Block class which implements the IBlockElement interface.
RadFixedDocument document = new RadFixedDocument();
FixedContentEditor editor = new FixedContentEditor(document.Pages.AddPage());
editor.GraphicProperties.IsFilled = false;
editor.GraphicProperties.IsStroked = true;
Block block = new Block();
block.InsertText("Some long text that will be split!");
Rect rectangle = new Rect(10, height, splitWidth, desiredSize.Height);
editor.DrawRectangle(rectangle);
block.Draw(editor, rectangle);
height += 10 + rectangle.Height;
hasPendingContent = block.HasPendingContent;
if (hasPendingContent)
{
block = block.Split();
}
}
while (hasPendingContent);
I hope this is helpful.
Regards,
Deyan
the Telerik team
Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.