PageElement.RelativeTo Property
Gets and sets placement of the page element on the page.
public RelativeTo RelativeTo { get; set; }
Public Property RelativeTo As RelativeTo
Property Value
Licensing Info
This property is a full DynamicPDF Core Suite feature. One of the following is required for non-evaluation usage:
- An active DynamicPDF Ultimate Subscription
- An active DynamicPDF Professional or Professional Plus Subscription with DynamicPDF Core Suite selected.
- A DynamicPDF Core Suite for .NET v12.X Developer License.
Examples
The following example will place the Label in the top-left of the page.using ceTe.DynamicPDF;
using ceTe.DynamicPDF.PageElements;
public class Example
{
public static void CreatePDF(string outputPath)
{
// Create a PDF Document
Document document = new Document();
// Create a Page and add it to the document
Page page = new Page();
document.Pages.Add(page);
// Create an Label and place it in page top left with margin
Label label = new Label("I am placed in Page top left with margin.", 0, 0, 160, 30);
label.RelativeTo = RelativeTo.TopLeft;
page.Elements.Add(label);
// Save the PDF
document.Draw(outputPath);
}
}