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

RelativeTo

Licensing Info

This property is a full DynamicPDF Core Suite feature. One of the following is required for non-evaluation usage:

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);
    }
}

See Also

PageElement
ceTe.DynamicPDF

In this topic