Skip to content

Instantly share code, notes, and snippets.

@bjoerntx
Created February 15, 2018 14:21
Show Gist options
  • Save bjoerntx/d2db4338fd0b8fc72961ef726f2c74f2 to your computer and use it in GitHub Desktop.
Save bjoerntx/d2db4338fd0b8fc72961ef726f2c74f2 to your computer and use it in GitHub Desktop.
// add a header
textControl1.Sections.GetItem().HeadersAndFooters.Add(HeaderFooterType.Header);
// retrieve the inserted header
HeaderFooter hed = textControl1.Sections.GetItem().HeadersAndFooters.GetItem(
HeaderFooterType.Header);
// create a new TextFrame
TextFrame frame = new TextFrame(new Size(3000, 3000));
// add the TextFrame to the header
hed.TextFrames.Add(frame,
textControl1.InputPosition.Page, // fixed on page
new Point(0, 2000),
TextFrameInsertionMode.BelowTheText | TextFrameInsertionMode.FixedOnPage);
// add text to TextFrame
frame.Selection.Text = "New TextFrame";
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment