New to Telerik Document ProcessingStart a free 30-day trial

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

Constructors

Initializes a new instance of the FixedContentEditor class.

C#
public FixedContentEditor(IContentRootElement root, bool autoTag = false)
Parameters:rootIContentRootElement

The root.

autoTagbool

A value indicating whether to automatically tag the content with structure tags.

Initializes a new instance of the FixedContentEditor class.

C#
public FixedContentEditor(IContentRootElement root, IPosition initialPosition, bool autoTag = false)
Parameters:rootIContentRootElement

The root.

initialPositionIPosition

The initial position.

autoTagbool

A value indicating whether to automatically tag the content with structure tags.

Methods

Draws the specified element.

C#
public void Draw(MarkedContent element)
Parameters:elementMarkedContent

The element.

Draws the specified element.

C#
public void Draw(PositionContentElement element)
Parameters:elementPositionContentElement

The element.

Draws the block in given size.

C#
public void DrawBlock(IBlockElement block, Size size)
Parameters:blockIBlockElement

The block.

sizeSize

The size.

Draws the block.

C#
public void DrawBlock(IBlockElement block)
Parameters:blockIBlockElement

The block.

Draws a circle.

C#
public void DrawCircle(Point center, double radius)
Parameters:centerPoint

The center.

radiusdouble

The radius.

Draws a ellipse.

C#
public void DrawEllipse(Point center, double radiusX, double radiusY)
Parameters:centerPoint

The center.

radiusXdouble

The radius X.

radiusYdouble

The radius Y.

Draws a form.

C#
public void DrawForm(FormSource source, double width, double height)
Parameters:sourceFormSource

The form source.

widthdouble

The width.

heightdouble

The height.

Draws a form.

C#
public void DrawForm(FormSource source, Size size)
Parameters:sourceFormSource

The form source.

sizeSize

The size.

Draws the form.

C#
public void DrawForm(FormSource source)
Parameters:sourceFormSource

The source.

Draws an ImageSource scaled to the specified width and height.

C#
public void DrawImage(ImageSource source, double width, double height)
Parameters:sourceImageSource

The image source.

widthdouble

Target width.

heightdouble

Target height.

Draws an ImageSource scaled to the specified size.

C#
public void DrawImage(ImageSource source, Size size)
Parameters:sourceImageSource

The image source.

sizeSize

Target size.

Draws an image from an existing ImageSource (already registered resource).

C#
public void DrawImage(ImageSource source)
Parameters:sourceImageSource

The image source.

Draws an image from a stream scaled to the specified width and height.

C#
public void DrawImage(Stream stream, double width, double height)
Parameters:streamStream

The stream containing the encoded image data.

widthdouble

Target width in document units.

heightdouble

Target height in document units.

Draws an image from a stream scaled to the specified size.

C#
public void DrawImage(Stream stream, Size size)
Parameters:streamStream

The stream containing the encoded image data.

sizeSize

Target size in document units.

Draws an image from a stream at its intrinsic size using the current position.

C#
public void DrawImage(Stream stream)
Parameters:streamStream

The stream containing the encoded image data.

Draws a line.

C#
public void DrawLine(Point point1, Point point2)
Parameters:point1Point

The point1.

point2Point

The 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.

C#
public void DrawLineAnnotation(double xDistance, double yDistance)
Parameters:xDistancedouble

The distance between the start and the end point of the line along the x-axis.

yDistancedouble

The distance between the start and the end point of the line along the y-axis.

Draws a path with given geometry.

C#
public void DrawPath(GeometryBase geometry)
Parameters:geometryGeometryBase

The geometry.

Draws a rectangle.

C#
public void DrawRectangle(Rect rectangle)
Parameters:rectangleRect

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.

C#
public void DrawStampAnnotation(Size annotationSize, string stampName)
Parameters:annotationSizeSize

The size of the stamp.

stampNamestring

The name of the stamp.

Draws the table with some fit table width.

C#
public void DrawTable(Table table, double width)
Parameters:tableTable

The table.

widthdouble

The width to fit the table in.

Draws the table.

C#
public void DrawTable(Table table, Size size)
Parameters:tableTable

The table.

sizeSize

The 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.

C#
public void DrawTable(Table table)
Parameters:tableTable

The table.

Draws the text.

C#
public void DrawText(string text, Size size)
Parameters:textstring

The text.

sizeSize

The size.

Draws the text using current text state at the current position.

C#
public void DrawText(string text)
Parameters:textstring

The text.

Creates a new TextAnnotation and draws it with a specified size and text and can create a PopupAnnotation to go with it.

C#
public void DrawTextAnnotation(Size annotationSize, Size popupSize, string text, bool addPopup = true)
Parameters:annotationSizeSize

The size of the text annotation.

popupSizeSize

The size of the popup annotation.

textstring

The text that will appear in the popup annotation.

addPopupbool

A 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.

C#
public void DrawWidget(RadioButtonField parentField, RadioOption option, Size annotationSize)
Parameters:parentFieldRadioButtonField

The form field the should be represented by the widget.

optionRadioOption

The option that should be represented by the widget.

annotationSizeSize

The 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.

C#
public void DrawWidget<T>(FormField<T> parentField, Size annotationSize) where T : Widget
Parameters:parentFieldFormField<T>

The form field the should be represented by the widget.

annotationSizeSize

The Annotation size.

Inserts the end of marked content.

C#
public void InsertMarkedContentEnd()

Inserts marked content start. If no structureTag is provided, the marked content will be tagged as an Artifact.

C#
public MarkedContent InsertMarkedContentStart(StructureElement structureTag = null)
Parameters:structureTagStructureElement

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:

MarkedContent

Pops the clipping.

C#
public Clipping PopClipping()
Returns:

Clipping

The clipping that was popped from the stack, or null if the stack is empty.

Pushes the clipping.

C#
public IDisposable PushClipping(GeometryBase clip)
Parameters:clipGeometryBase

The clip.

Returns:

IDisposable

A disposable object that will pop the clipping when disposed.

Pushes the clipping.

C#
public IDisposable PushClipping(Rect clip)
Parameters:clipRect

The clip.

Returns:

IDisposable

A disposable object that will pop the clipping when disposed.

Restores the position.

C#
public void RestorePosition()

Saves the position.

C#
public IDisposable SavePosition()
Returns:

IDisposable

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.

C#
public Clipping Clipping { get; }
Property Value:

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.

C#
public IPosition Position { get; set; }
Property Value:

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.

C#
public IContentRootElement Root { get; }
Property Value:

The root element that contains all the fixed content.