TextFrames, Images, BarcodeFrames and ChartFrames provide different ways to position those objects in the document. All objects are positioned in the same way as they are inherited from the base class FrameBase.

Based on TextFrames, let's have a look at the various positioning options:

public bool Add(TextFrame textFrame, int textPosition);

public bool Add(TextFrame textFrame,
        int page, 
        System.Drawing.Point location, 
        TextFrameInsertionMode insertionMode);
                        
public bool Add(TextFrame textFrame,
        HorizontalAlignment alignment, 
        int textPosition, 
        TextFrameInsertionMode insertionMode);
        
public bool Add(TextFrame textFrame, 
        System.Drawing.Point location, 
        int textPosition, 
        TextFrameInsertionMode insertionMode);

The first overload inserts a TextFrame at a specific text position and the absolute location can be easily obtained using the TextChar class or the InputPositon. The second method inserts the TextFrame at a fixed position on a page and the Location property of the TextFrame returns the absolute position automatically.

Getting the absolute position of TextFrames that are inserted using the last two methods is a little tricky, but easily solvable with TextControl's flexible API. The following method returns the absolute position of a TextFrame that is anchored to a text position.

private Rectangle GetAbsolutePositionOfAnchoredTextFrame(TextFrame TextFrame)
{
        Graphics g = this.CreateGraphics();
        int iDPIFactor = (int)(1440 / g.DpiX);

        Rectangle rectAbsolutePosition = new Rectangle();

        if (textControl1.TextChars[frame.TextPosition] == null)
                throw new Exception("Text position doesn't exist");
        
        Rectangle rectAnchorOffset =
                textControl1.TextChars[frame.TextPosition].Bounds;

        rectAbsolutePosition.X = (frame.Location.X +
                rectAnchorOffset.X -
                textControl1.ScrollLocation.X) / iDPIFactor;
                
        rectAbsolutePosition.Y = (frame.Location.Y + 
                rectAnchorOffset.Y - 
                textControl1.ScrollLocation.Y) / iDPIFactor;

        rectAbsolutePosition.Width = frame.Size.Width / iDPIFactor;
        rectAbsolutePosition.Height = frame.Size.Height / iDPIFactor;

        return rectAbsolutePosition;
}

Anchored objects return the relative Location to the anchor position. This location of the anchor position can be obtained using the TextChar class:

Rectangle rectAnchorOffset =
textControl1.TextChars[frame.TextPosition].Bounds;

Additionally, the current ScrollLocation must be included in the calculation. The iDPIFactor is used to convert Twips to the required 1/100 inch that are used in .NET Windows Forms.