Posted by a ceTe Software moderator
Hello,
Yes, you can dynamically calculate the X and Y positions for the page elements. You can set the Y position for the new page element with this newly calculated Y position. Below is the sample code for it.
Document document = new Document();
Page page = new Page();
string formattedText = "Using DynamicPDF Generator for .NET is very straight forward and the object model can be learned very quickly. There are three common objects that are used: Document, Page, and Page Element objects. ";
FormattedTextArea formattedTextArea = new FormattedTextArea(formattedText, 0, 0, 200, 200, FontFamily.Helvetica, 14, true);
page.Elements.Add(formattedTextArea);
float newXposition = formattedTextArea.X;
float newYposition = formattedTextArea.Y + formattedTextArea.GetRequiredHeight()+10;
FormattedTextArea newFormattedTextArea = new FormattedTextArea("New FormattedTextArea", newXposition, newYposition, 200, 200, FontFamily.Helvetica, 14, true);
page.Elements.Add(newFormattedTextArea);
document.Pages.Add(page);
document.Draw(@"C:\MyDocument.pdf");
Thanks,
ceTe Software Support Team