FixedContentEditor
Edit fixed-page content by positioning text, images, forms, and shapes with precise coordinates, clipping, and state management. Use to draw directly onto a page or form XObject and control layout via the current IPosition and clipping stack; coordinates originate at the top-left with X to the right and Y downward.
Definition
Namespace:Telerik.Windows.Documents.Fixed.Model.Editing
Assembly:Telerik.Windows.Documents.Fixed.dll
Syntax:
public class FixedContentEditor : FixedContentEditorBase
Inheritance: objectFixedContentEditorBaseFixedContentEditor
Inherited Members
Constructors
Initializes a new instance of the FixedContentEditor class.
public FixedContentEditor(IContentRootElement root, bool autoTag = false)
The root.
autoTagboolA value indicating whether to automatically tag the content with structure tags.
Initializes a new instance of the FixedContentEditor class.
public FixedContentEditor(IContentRootElement root, IPosition initialPosition, bool autoTag = false)
The root.
initialPositionIPositionThe initial position.
autoTagboolA value indicating whether to automatically tag the content with structure tags.
Methods
Draws the specified element.
Draws the specified element.
public void Draw(PositionContentElement element)
The element.
Draws the block in given size.
public void DrawBlock(IBlockElement block, Size size)
The block.
sizeSizeThe size.
Draws the block.
Draws a circle.
public void DrawCircle(Point center, double radius)
The center.
radiusdoubleThe radius.
Draws a form.
public void DrawForm(FormSource source, double width, double height)
The form source.
widthdoubleThe width.
heightdoubleThe height.
Draws a form.
public void DrawForm(FormSource source, Size size)
The form source.
sizeSizeThe size.
Draws the form.
Draws an ImageSource scaled to the specified width and height.
public void DrawImage(ImageSource source, double width, double height)
The image source.
widthdoubleTarget width.
heightdoubleTarget height.
Draws an ImageSource scaled to the specified size.
public void DrawImage(ImageSource source, Size size)
The image source.
sizeSizeTarget size.
Draws an image from an existing ImageSource (already registered resource).
Draws an image from a stream scaled to the specified size.
public void DrawImage(Stream stream, Size size)
The stream containing the encoded image data.
sizeSizeTarget size in document units.
Draws an image from a stream at its intrinsic size using the current position.
public void DrawImage(Stream stream)
The stream containing the encoded image data.
Draws a line.
public void DrawLine(Point point1, Point point2)
The point1.
point2PointThe point2.
Creates a new LineAnnotation with starting point the current point of the editor and end point the current point of the editor plus the given distances.
Draws a path with given geometry.
Draws a rectangle.
public void DrawRectangle(Rect rectangle)
The rectangle.
Creates a new StampAnnotation and draws it with a specified Annotation size and name. This method will add the stamp only in cases when the FixedContentEditor Root supports annotations.
public void DrawStampAnnotation(Size annotationSize, string stampName)
The size of the stamp.
stampNamestringThe name of the stamp.
Draws the table.
public void DrawTable(Table table, Size size)
The table.
sizeSizeThe size to fit the table in. Only the rows that fit in the given hight are drawn. The rest of the table can be taken with the table.Split() method.
Draws the table.
Draws the text.
Draws the text using current text state at the current position.
Creates a new TextAnnotation and draws it with a specified size and text and can create a PopupAnnotation to go with it.
public void DrawTextAnnotation(Size annotationSize, Size popupSize, string text, bool addPopup = true)
The size of the text annotation.
popupSizeSizeThe size of the popup annotation.
textstringThe text that will appear in the popup annotation.
addPopupboolA value indicating whether to create a popup for the text annotation.
Creates new RadioButtonWidget representing a RadioButtonField and draws the widget with a specified Annotation size. This method will add widget only in cases when the FixedContentEditor Root supports annotations.
public void DrawWidget(RadioButtonField parentField, RadioOption option, Size annotationSize)
The form field the should be represented by the widget.
optionRadioOptionThe option that should be represented by the widget.
annotationSizeSizeThe Annotation size.
Creates new Widget representing a FormField and draws the widget with a specified Annotation size. This method will add widget only in cases when the FixedContentEditor Root supports annotations.
public void DrawWidget<T>(FormField<T> parentField, Size annotationSize) where T : Widget
The form field the should be represented by the widget.
annotationSizeSizeThe Annotation size.
Inserts the end of marked content.
public void InsertMarkedContentEnd()
Inserts marked content start. If no structureTag is provided, the marked content will be tagged as an Artifact.
public MarkedContent 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.
Returns:Pops the clipping.
public Clipping PopClipping()
The clipping that was popped from the stack, or null if the stack is empty.
Pushes the clipping.
public IDisposable PushClipping(GeometryBase clip)
The clip.
Returns:A disposable object that will pop the clipping when disposed.
Pushes the clipping.
public IDisposable PushClipping(Rect clip)
The clip.
Returns:A disposable object that will pop the clipping when disposed.
Restores the position.
public void RestorePosition()
Saves the position.
public IDisposable SavePosition()
A disposable object that will restore the position when disposed.
Properties
Gets the current clipping object which defines the visible region for content rendering. Content drawn outside the current clipping region will not be visible in the document. Returns null if no clipping is currently defined.
public Clipping Clipping { get; }
The current Clipping object or null if no clipping is applied.
Gets or sets the current position where content will be added in the document. The position is used as the starting point for rendering operations and is updated automatically when content is added.
public IPosition Position { get; set; }
An IPosition object representing the current position in the document.
Gets the root element for the fixed content, which serves as the container for all content created by this editor. This is typically a page or form object in a PDF document.
public IContentRootElement Root { get; }
The root element that contains all the fixed content.