Posted by a ceTe Software moderator
Hello,
Below is the sample code that has the scenario you have described where there is a small text at the same location on all the pages and the FormattedTextArea overflows to different pages. When you instantiate the FormattedTextArea the x & y coordinates and the height and width will remain the same with respect to the page that it overflowed to. In case you need to change the location of the text area in the second page you can set the x & y coordinates of the overflow FormattedTextArea accordingly.
Document document = new Document();
string myText = "This is a test of the overflow text functionality. ";
myText += myText;
myText += myText;
myText += myText;
myText += myText;
myText += myText;
FormattedTextArea textArea = new FormattedTextArea(myText, 0, 50, 200, 200, FontFamily.Helvetica, 12, true);
do
{
Page page = new Page();
page.Elements.Add(new Label("small text",100,10,100,10));
page.Elements.Add(textArea);
document.Pages.Add(page);
textArea = textArea.GetOverflowFormattedTextArea();
} while (textArea != null);
document.Draw(@"test.pdf");
If you run the loop for 30 times in the previously posted code the text area shrinks as the margins of the page are increasing and the height and width of the text area is adjusted this is expected behavior. This code is just a proof-of-concept code to demonstrate how one can change the page margins and the dimensions of page elements.
Thanks,
ceTe Software Support Team.