AttributeClass
Represents a attribute class.
public class AttributeClass
Inheritance: ObjectAttributeClass
Licensing Info
This class 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 shows how to use an attribute classes.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();
// Specify document as a tagged PDF
document.Tag = new TagOptions();
// Create a page and add it to the document
Page page = new Page();
document.Pages.Add(page);
// Create a text area
TextArea textArea = new TextArea("This is the " +
"text of a TextArea", 100, 100, 400, 30,
ceTe.DynamicPDF.Font.HelveticaBoldOblique, 18);
// Create a structure element
StructureElement structureElement = new StructureElement(TagType.Paragraph, true);
// Create an attribute class
AttributeClass attributeClass = new AttributeClass("MyAttribueClass");
// Create an attribute object
AttributeObject attributeObject1 = new AttributeObject(AttributeOwner.Layout);
// Add attributes to the attribute object
attributeObject1.SetLineHeight(); // Sets default value to the line height attribute
attributeObject1.SetHeight(30); // Sets specified value to the height attribute
// Add attribute object to the attribute class
attributeClass.AttributeObjects.Add(attributeObject1);
// Create an attribute object
AttributeObject attributeObject2 = new AttributeObject(AttributeOwner.HTML_3_20);
// Add attributes to the attribute object
attributeObject2.SetPlacement(); // Sets default value to the line height attribute
attributeObject2.SetSpaceBefore(); // Sets default value to the space after attribute
// Add attribute object to the attribute class
attributeClass.AttributeObjects.Add(attributeObject2);
// Add attribute class to the structure element
structureElement.Classes.Add(attributeClass);
// Tag the text area with the structure element
textArea.Tag = structureElement;
// Add the text area to the page
page.Elements.Add(textArea);
// Save the PDF
document.Draw( outputPath );
}
}
Constructors
AttributeClass(String) | Initializes a new instance of the attribute class. |
Properties
AttributeObjects | Gets the collection of attribute objects. |
Methods
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) |