Label

Represents a label page element.

public class Label : RotatingPageElement, IArea, ICoordinate, ISerializable
Public Class Label
    Inherits RotatingPageElement
    Implements IArea, ICoordinate, ISerializable

Inheritance: ObjectPageElementTaggablePageElementRotatingPageElementLabel

Implements: IArea, ICoordinate, ISerializable

Licensing Info

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

Examples

The following example will display text in a label on the page.
Imports System
Imports ceTe.DynamicPDF
Imports ceTe.DynamicPDF.PageElements
     
Module MyModule
     		
    Sub Main()
     		
        ' Create a PDF Document
        Dim MyDocument As Document = New Document 
     		
        ' Create a Page and add it to the document
        Dim MyPage As Page = New Page
        MyDocument.Pages.Add(MyPage)
     
        ' Create the string and label
        Dim MyText As String = "This is the dark blue, centered text at a 15 degree angle contained in the label."
        Dim MyLabel As Label = New Label(MyText, 0, 0, 512, 14, Font.Helvetica, 14, TextAlign.Center, RgbColor.DarkBlue)
     
        ' Change the angle property 
        MyLabel.Angle = 15
     
        ' Add the label to the page
        MyPage.Elements.Add(MyLabel)
     
        ' Save the PDF
        MyDocument.Draw("C:\MyDocument.pdf")
     		
    End Sub
End Module
using System;
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 the string and label
        string text = "This is the dark blue, centered text at a 15 degree angle contained in the label.";
        Label label = new Label(text, 0, 0, 512, 14, Font.Helvetica, 14, TextAlign.Center, RgbColor.DarkBlue);
 
        // Change the angle property
        label.Angle = 15;
 
        // Add the label to the page
        page.Elements.Add(label);	
 
        // Save the PDF
        document.Draw(outputPath);
    } 
}

Remarks

This class can be used to place labels of text on a page.

Constructors

Label(String, Single, Single, Single, Single)Initializes a new instance of the Label class.
Label(String, Single, Single, Single, Single, Font)Initializes a new instance of the Label class.
Label(String, Single, Single, Single, Single, Font, Single)Initializes a new instance of the Label class.
Label(String, Single, Single, Single, Single, Font, Single, Color)Initializes a new instance of the Label class.
Label(String, Single, Single, Single, Single, Font, Single, TextAlign)Initializes a new instance of the Label class.
Label(String, Single, Single, Single, Single, Font, Single, TextAlign, Color)Initializes a new instance of the Label class.

Properties

AlignGets or sets the Align enumeration that specifies the text alignment of the label.
AngleGets or sets the heights of the angle element.
(Inherited from RotatingPageElement)
FontGets or sets the Font object to use for the text of the label.
FontSizeGets or sets the font size for the text of the label.
HeightGets or sets the height or the label.
IDGets or sets the ID of the page element.
(Inherited from PageElement)
IgnoreMarginsGets or sets ignore margin property. Setting false will consider the margin while placing the page element based on the RelativeTo property.
(Inherited from PageElement)
RelativeToGets and sets placement of the page element on the page.
(Inherited from PageElement)
RightToLeftGets or sets a value indicating if text should be displayed right to left.
StrikethroughGets or sets the strike through to use for the text of the label.
TagGets or sets the tag of the taggable element.
(Inherited from TaggablePageElement)
TagOrderGets or sets the tag order of the taggable element.
(Inherited from TaggablePageElement)
TextGets or sets the text of the label.
TextColorGets or sets the Color object to use for the text of the label.
TextOutlineColorGets or sets the Color object to use for the text outline of the label.
TextOutlineWidthGets or sets the line width to use for the text outline of the label.
UnderlineGets or sets a value indicating if the label is underlined.
VAlignGets or sets the VAlign enumeration that specifies the vertical text alignment of the label.
WidthGets or sets the width or the label.
XGets or sets the X coordinate of the page element.
(Inherited from RotatingPageElement)
YGets or sets the Y coordinate of the page element.
(Inherited from RotatingPageElement)

Methods

Draw(PageWriter)Draws the page element to the given PageWriter object.
(Inherited from RotatingPageElement)
Equals(Object)Determines whether the specified Object is equal to the current Object .
(Inherited from Object)
GetHashCode()Serves as a hash function for a particular type.
(Inherited from Object)
GetType()Gets the Type of the current instance.
(Inherited from Object)
ToString()Returns a String that represents the current Object .
(Inherited from Object)

See Also

ceTe.DynamicPDF.PageElements

In this topic