cete.dynamicpdf.attributeclass
AttributeClass
- Namespace: ceTe.DynamicPDF
- Assemblies: ceTe.DynamicPDF.40.dll
Represents a attribute class.
public class AttributeClass
Public Class AttributeClass
Inheritance: Object → AttributeClass
Licensing
This class is a DynamicPDF Generator Enterprise Edition feature. One of the following licenses is required for non-evaluation usage:
- DynamicPDF Generator for .NET Enterprise Edition
- DynamicPDF Merger for .NET Enterprise Edition
- DynamicPDF ReportWriter for .NET Enterprise Edition
- DynamicPDF Core Suite for .NET Enterprise Edition
Examples
The following example shows how to use an attribute classes.
Imports System
Imports ceTe.DynamicPDF
Imports ceTe.DynamicPDF.PageElements
Module MyModule Sub Main() ' Create a PDF Document Dim MyDocument As Document = New Document
' Specify document as a tagged PDF
MyDocument.Tag = New TagOptions()
' Create a page and add it to the document
Dim MyPage As Page = New Page()
MyDocument.Pages.Add(MyPage)
' Create a text area
Dim MyTextArea As TextArea = New TextArea("This is the text of a TextArea", _
100, 100, 400, 30, _
ceTe.DynamicPDF.Font.HelveticaBoldOblique, 18)
' Create a structue element
Dim MyStructureElement As StructureElement = New StructureElement(TagType.Paragraph, True)
' Create an attribute class
Dim MyAttributeClass As AttributeClass = New AttributeClass("MyAttribueClass")
' Create an attribute object
Dim MyAttributeObject1 As AttributeObject = New AttributeObject(AttributeOwner.Layout)
' Add attributes to the attribute object
MyAttributeObject1.SetLineHeight() 'Sets default value to the line height attribute
MyAttributeObject1.SetHeight(30) ' Sets specified value to the height attribute
' Add attribute object to the attribute class
MyAttributeClass.AttributeObjects.Add(MyAttributeObject1)
' Create an attribute object
Dim MyAttributeObject2 As AttributeObject = New AttributeObject(AttributeOwner.HTML_3_20)
' Add attributes to the attribute object
MyAttributeObject2.SetPlacement() ' Sets default value to the line height attribute
MyAttributeObject2.SetSpaceBefore() ' Sets default value to the space after attribute
' Add attribute object to the attribute class
MyAttributeClass.AttributeObjects.Add(MyAttributeObject2)
' Add attribute class to the structure element
MyStructureElement.Classes.Add(MyAttributeClass)
' Tag the text area with the structure element
MyTextArea.Tag = MyStructureElement
' Add the text area to the page
MyPage.Elements.Add(MyTextArea)
' Save the PDF MyDocument.Draw("C:\MyDocument.pdf") End Sub
End Module
using System;
using ceTe.DynamicPDF;
using ceTe.DynamicPDF.PageElements;
class MyClass
{static void Main(){ // 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 structue 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( @"C:\MyDocument.pdf" );}
}
Constructors
AttributeClass(String)
Intializes a new instance of the attribute class.
public AttributeClass(string attributeClassName)
Public Sub New (attributeClassName As String)
Parameters
- attributeClassName: String
Name of the attribute class.
Properties
AttributeObjects
Gets the collection of attribute objects.
public AttributeTypeList AttributeObjects { get; }
Public Property AttributeObjects As AttributeTypeList
Property Value
Methods
Equals(Object)
Determines whether the specified Object is equal to the current Object . (Inherited from Object)
public bool Equals(Object obj)
Function Equals(obj As Object) As Boolean
Parameters
- obj: Object
The Object to compare with the current Object .
Returns
true if the specified Object is equal to the current Object ; otherwise, false.
GetHashCode()
Serves as a hash function for a particular type. (Inherited from Object)
public int GetHashCode()
Function GetHashCode() As Integer
Returns
A hash code for the current Object .
GetType()
Gets the Type of the current instance. (Inherited from Object)
public Type GetType()
Function GetType() As Type
Returns
The Type instance that represents the exact runtime type of the current instance.
ToString()
Returns a String that represents the current Object . (Inherited from Object)
public string ToString()
Function ToString() As String
Returns
A String that represents the current Object .