Block
Flowing-content container that lays out inline elements, images, and forms with indentation, spacing, alignment, and background for pagination. Use it to accumulate and arrange runs and inline content before measuring and drawing onto the document.
Definition
Namespace:Telerik.Documents.Fixed.Model.Editing
Assembly:Telerik.Windows.Documents.Fixed.dll
Syntax:
public class Block : FixedContentEditorBase, IBlockElement
Inheritance: objectFixedContentEditorBaseBlock
Implements:
Inherited Members
Constructors
Properties
ActualSize
Size
Gets the actual size of the block after it is drawn.
public Size ActualSize { get; }
The actual size.
Gets or sets the background color.
public ColorBase BackgroundColor { get; set; }
The background color.
Gets or sets the bullet element.
public PositionContentElement Bullet { get; set; }
The bullet element.
DesiredSize
Size
Gets the desired size.
public Size DesiredSize { get; }
The desired size.
Implements:
Gets or sets the first line indent.
public double FirstLineIndent { get; set; }
The first line indent.
Gets a value indicating whether this block has any open marked content segments that haven't been closed. Marked content is used to identify specific content within a PDF for various purposes such as accessibility, structure, or logical organization.
public bool HasOpenMarkedContent { get; }
true if this block has open marked content segments; otherwise, false.
Implements:
Gets if there is any pending content after the last measure.
public bool HasPendingContent { get; }
Boolean value indicating whether there is any pending content after the last measure.
Implements:
Gets or sets the horizontal alignment.
public HorizontalAlignment HorizontalAlignment { get; set; }
The horizontal alignment.
Gets or sets the indent after the bullet element.
public double IndentAfterBullet { get; set; }
The indent after the bullet element.
Indicates if the block contains any elements.
public bool IsEmpty { get; }
True if the block does not contain any elements.
Gets or sets the left indent.
public double LeftIndent { get; set; }
The left indent.
Gets or sets the line spacing.
public double LineSpacing { get; set; }
The line spacing.
Gets or sets the value indicating how the spacing between lines is calculated.
public HeightType LineSpacingType { get; set; }
The type line spacing rule.
Gets the pending elements.
public IEnumerable<LayoutElementBase> PendingElements { get; }
The pending elements.
Gets or sets the right indent.
public double RightIndent { get; set; }
The right indent.
Gets or sets the spacing after.
public double SpacingAfter { get; set; }
The spacing after.
Gets or sets the spacing before.
public double SpacingBefore { get; set; }
The spacing before.
Gets or sets the vertical alignment.
public VerticalAlignment VerticalAlignment { get; set; }
The vertical alignment.
Methods
Clears the block children.
public void Clear()
Draws the block element with the specified editor.
public void Draw(FixedContentEditor editor, Rect boundingRect)
The editor.
boundingRectRectThe bounding rectangle.
Implements:
Inserts the specified layout element.
Inserts the specified element.
public void Insert(PositionContentElement element)
The element.
Inserts a circle.
public void InsertCircle(Point center, double radius)
The center.
radiusdoubleThe radius.
Inserts a form.
public void InsertForm(FormSource source, double width, double height)
The form source.
widthdoubleThe width.
heightdoubleThe height.
Inserts a form.
public void InsertForm(FormSource source, Size size)
The form source.
sizeSizeThe size.
Inserts a form.
Inserts hyperlink end.
public void InsertHyperlinkEnd()
Inserts hyperlink start.
public void InsertHyperlinkStart(Destination destination)
The destination.
Inserts hyperlink start.
public void InsertHyperlinkStart(Uri uri)
The URI.
Inserts an ImageSource scaled to the specified width and height.
public void InsertImage(ImageSource source, double width, double height)
The image source.
widthdoubleTarget width.
heightdoubleTarget height.
Inserts an ImageSource scaled to the specified size.
public void InsertImage(ImageSource source, Size size)
The image source.
sizeSizeTarget size.
Inserts an image represented by an existing ImageSource at its intrinsic size.
Inserts an image from a stream scaled to the specified size.
public void InsertImage(Stream stream, Size size)
The stream containing the encoded image data.
sizeSizeTarget size.
Inserts an image from a stream at its intrinsic size at the current inline position in the block.
public void InsertImage(Stream stream)
The stream containing the encoded image data.
Inserts a line.
public void InsertLine(Point point1, Point point2)
The point1.
point2PointThe point2.
Inserts a line break.
public void InsertLineBreak()
Inserts marked content end.
public void InsertMarkedContentEnd()
Inserts marked content start. If no structureTag is provided, the marked content will be tagged as an Artifact.
public void InsertMarkedContentStart(StructureElement structureTag = null)
The structure element tag that relates the marked content with the document's structure tree. If null, the content is tagged as an artifact.
Inserts a path.
Inserts the specified layout elements.
public void InsertRange(IEnumerable<LayoutElementBase> elements)
The elements.
Inserts a rectangle.
public void InsertRectangle(Rect rectangle)
The rectangle.
Inserts the text using the given font family, font style and font weight.
public void InsertText(FontFamily fontFamily, FontStyle fontStyle, FontWeight fontWeight, string text)
The font family.
fontStyleFontStyleThe font style.
fontWeightFontWeightThe font weight.
textstringThe text.
Inserts the text using the given font family.
public void InsertText(FontFamily fontFamily, string text)
The font family.
textstringThe text.
Inserts the text.
Measures the block in the infinite size.
public Size Measure()
Size
The block size.
Measures the block element with specified available size.
public Size Measure(Size availableSize, CancellationToken cancellationToken)
The available size.
cancellationTokenCancellationTokenThe cancellation token used to cancel the operation.
Returns:Size
The result size.
Implements: