Class
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

Constructors

FixedContentEditor(IContentRootElement, IPosition, bool)

Initializes a new instance of the FixedContentEditor class.

Declaration

cs-api-definition
public FixedContentEditor(IContentRootElement root, IPosition initialPosition, bool autoTag = false)

Parameters

root

IContentRootElement

The root.

initialPosition

IPosition

The initial position.

autoTag

bool

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

FixedContentEditor(IContentRootElement, bool)

Initializes a new instance of the FixedContentEditor class.

Declaration

cs-api-definition
public FixedContentEditor(IContentRootElement root, bool autoTag = false)

Parameters

root

IContentRootElement

The root.

autoTag

bool

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

Properties

Clipping

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.

Declaration

cs-api-definition
public Clipping Clipping { get; }

Property Value

Clipping

The current Clipping object or null if no clipping is applied.

Position

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.

Declaration

cs-api-definition
public IPosition Position { get; set; }

Property Value

IPosition

An IPosition object representing the current position in the document.

Root

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.

Declaration

cs-api-definition
public IContentRootElement Root { get; }

Property Value

IContentRootElement

The root element that contains all the fixed content.

Methods

Draw(MarkedContent)

Draws the specified element.

Declaration

cs-api-definition
public void Draw(MarkedContent element)

Parameters

element

MarkedContent

The element.

Draw(PositionContentElement)

Draws the specified element.

Declaration

cs-api-definition
public void Draw(PositionContentElement element)

Parameters

element

PositionContentElement

The element.

DrawBlock(IBlockElement)

Draws the block.

Declaration

cs-api-definition
public void DrawBlock(IBlockElement block)

Parameters

block

IBlockElement

The block.

DrawBlock(IBlockElement, Size)

Draws the block in given size.

Declaration

cs-api-definition
public void DrawBlock(IBlockElement block, Size size)

Parameters

block

IBlockElement

The block.

size

Size

The size.

DrawCircle(Point, double)

Draws a circle.

Declaration

cs-api-definition
public void DrawCircle(Point center, double radius)

Parameters

center

Point

The center.

radius

double

The radius.

DrawEllipse(Point, double, double)

Draws a ellipse.

Declaration

cs-api-definition
public void DrawEllipse(Point center, double radiusX, double radiusY)

Parameters

center

Point

The center.

radiusX

double

The radius X.

radiusY

double

The radius Y.

DrawForm(FormSource)

Draws the form.

Declaration

cs-api-definition
public void DrawForm(FormSource source)

Parameters

source

FormSource

The source.

DrawForm(FormSource, Size)

Draws a form.

Declaration

cs-api-definition
public void DrawForm(FormSource source, Size size)

Parameters

source

FormSource

The form source.

size

Size

The size.

DrawForm(FormSource, double, double)

Draws a form.

Declaration

cs-api-definition
public void DrawForm(FormSource source, double width, double height)

Parameters

source

FormSource

The form source.

width

double

The width.

height

double

The height.

DrawImage(ImageSource)

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

Declaration

cs-api-definition
public void DrawImage(ImageSource source)

Parameters

source

ImageSource

The image source.

DrawImage(ImageSource, Size)

Draws an ImageSource scaled to the specified size.

Declaration

cs-api-definition
public void DrawImage(ImageSource source, Size size)

Parameters

source

ImageSource

The image source.

size

Size

Target size.

DrawImage(ImageSource, double, double)

Draws an ImageSource scaled to the specified width and height.

Declaration

cs-api-definition
public void DrawImage(ImageSource source, double width, double height)

Parameters

source

ImageSource

The image source.

width

double

Target width.

height

double

Target height.

DrawImage(Stream)

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

Declaration

cs-api-definition
public void DrawImage(Stream stream)

Parameters

stream

Stream

The stream containing the encoded image data.

DrawImage(Stream, Size)

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

Declaration

cs-api-definition
public void DrawImage(Stream stream, Size size)

Parameters

stream

Stream

The stream containing the encoded image data.

size

Size

Target size in document units.

DrawImage(Stream, double, double)

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

Declaration

cs-api-definition
public void DrawImage(Stream stream, double width, double height)

Parameters

stream

Stream

The stream containing the encoded image data.

width

double

Target width in document units.

height

double

Target height in document units.

DrawLine(Point, Point)

Draws a line.

Declaration

cs-api-definition
public void DrawLine(Point point1, Point point2)

Parameters

point1

Point

The point1.

point2

Point

The point2.

DrawLineAnnotation(double, double)

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.

Declaration

cs-api-definition
public void DrawLineAnnotation(double xDistance, double yDistance)

Parameters

xDistance

double

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

yDistance

double

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

DrawPath(GeometryBase)

Draws a path with given geometry.

Declaration

cs-api-definition
public void DrawPath(GeometryBase geometry)

Parameters

geometry

GeometryBase

The geometry.

DrawRectangle(Rect)

Draws a rectangle.

Declaration

cs-api-definition
public void DrawRectangle(Rect rectangle)

Parameters

rectangle

Rect

The rectangle.

DrawStampAnnotation(Size, string)

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.

Declaration

cs-api-definition
public void DrawStampAnnotation(Size annotationSize, string stampName)

Parameters

annotationSize

Size

The size of the stamp.

stampName

string

The name of the stamp.

DrawTable(Table)

Draws the table.

Declaration

cs-api-definition
public void DrawTable(Table table)

Parameters

table

Table

The table.

DrawTable(Table, Size)

Draws the table.

Declaration

cs-api-definition
public void DrawTable(Table table, Size size)

Parameters

table

Table

The table.

size

Size

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.

DrawTable(Table, double)

Draws the table with some fit table width.

Declaration

cs-api-definition
public void DrawTable(Table table, double width)

Parameters

table

Table

The table.

width

double

The width to fit the table in.

DrawText(string)

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

Declaration

cs-api-definition
public void DrawText(string text)

Parameters

text

string

The text.

DrawText(string, Size)

Draws the text.

Declaration

cs-api-definition
public void DrawText(string text, Size size)

Parameters

text

string

The text.

size

Size

The size.

DrawTextAnnotation(Size, Size, string, bool)

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

Declaration

cs-api-definition
public void DrawTextAnnotation(Size annotationSize, Size popupSize, string text, bool addPopup = true)

Parameters

annotationSize

Size

The size of the text annotation.

popupSize

Size

The size of the popup annotation.

text

string

The text that will appear in the popup annotation.

addPopup

bool

A value indicating whether to create a popup for the text annotation.

DrawWidget(RadioButtonField, RadioOption, Size)

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.

Declaration

cs-api-definition
public void DrawWidget(RadioButtonField parentField, RadioOption option, Size annotationSize)

Parameters

parentField

RadioButtonField

The form field the should be represented by the widget.

option

RadioOption

The option that should be represented by the widget.

annotationSize

Size

The Annotation size.

DrawWidget<T>(FormField<T>, 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.

Declaration

cs-api-definition
public void DrawWidget<T>(FormField<T> parentField, Size annotationSize) where T : Widget

Parameters

parentField

FormField<T>

The form field the should be represented by the widget.

annotationSize

Size

The Annotation size.

InsertMarkedContentEnd()

Inserts the end of marked content.

Declaration

cs-api-definition
public void InsertMarkedContentEnd()

InsertMarkedContentStart(StructureElement)

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

Declaration

cs-api-definition
public MarkedContent InsertMarkedContentStart(StructureElement structureTag = null)

Parameters

structureTag

StructureElement

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

PopClipping()

Pops the clipping.

Declaration

cs-api-definition
public Clipping PopClipping()

Returns

Clipping

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

PushClipping(GeometryBase)

Pushes the clipping.

Declaration

cs-api-definition
public IDisposable PushClipping(GeometryBase clip)

Parameters

clip

GeometryBase

The clip.

Returns

IDisposable

A disposable object that will pop the clipping when disposed.

PushClipping(Rect)

Pushes the clipping.

Declaration

cs-api-definition
public IDisposable PushClipping(Rect clip)

Parameters

clip

Rect

The clip.

Returns

IDisposable

A disposable object that will pop the clipping when disposed.

RestorePosition()

Restores the position.

Declaration

cs-api-definition
public void RestorePosition()

SavePosition()

Saves the position.

Declaration

cs-api-definition
public IDisposable SavePosition()

Returns

IDisposable

A disposable object that will restore the position when disposed.