Text Object Attributes

 

Additional to the Common Attributes, this object has the following attributes:

Attribute Name

Description

Type

Values

Default Value

Text

String of text contained in object.

String

 

NULL

TextColor

Color for drawing text.

Color

COLORREF (bbggrr) 000000 to FFFFFF

or in or in COLORREF (aabbggrr) 00000000 to FFFFFFFF

000000 (Solid black)

TextFont

Font name and style for drawing text

Font

String in the form of: FontName,FontSize, Weight,Italic,Underline

Example: "Arial,14,400,0,0"

NULL

BackColor

Background color.

Color

COLORREF (bbggrr) 000000 to FFFFFF

or in COLORREF (aabbggrr) 00000000 to FFFFFFFF

FFFFFFFF (Transparent)

HorzAlign

Horizontal text alignment.

enum IacHorzAlign

1: acHorzAlignLeft

2: acHorzAlignCenter

3 :acHorzAlignRight

4: acHorzJustify

1: acHorzAlignLeft

VertAlign

Vertical text alignment.

enum IacVertAlign

1: acVertAlignTop

2 :acVertAlignCenter

3 :acVertAlignBottom

1: acVertAlignTop

TextGap

Gap between text and borders.

enum IacTextGap

Units are in points or 12th of an inch.

0: acTextGapNone

1: acTextGapThin

2 :acTextGapMedium

3: acTextGapThick

0 :acTextgapNone

BorderColor

Color for drawing text border.

Color

COLORREF (bbggrr) 000000 to FFFFFF

or in COLORREF (aabbggrr) 00000000 to FFFFFFFF

000000 (Solid black)

BorderWidth

Width of border around text.

enum IacBorderWidth

Units are in points or 12th of an inch.

0: acBorderWidthNone

1: acBorderWidthSimple

2: acBorderWidthDouble

3: acBorderWidthTriple

4: acBorderWidthQuadruple

0: acBorderWidthNone

CharSpacing

Spacing between characters.

Integer

10th of a Twip

0

WordSpacing

Spacing between words.

Integer

10th of a Twip

0

TextAngle

Angle for drawing text.

Integer

10th of a degree

0

Horizontal Scale

Horizontal scaling factor.

Integer

Percentage

100

Indentation

Paragraph indentation.

Integer

10th of a Twip

0

Allow Word Breaks

Allows breaking words on special characters ( +, -, *, (, ), =, etc).

Boolean

True / False

False

Single line

Text is limited to a single line.

Boolean

True / False

False

FormattedText

It is the string contents of the cell that includes formatting information such as Bold or Italic.

String

 

NULL

The Formatted Text property allows the user to specify the text that has some sections formatted with a given format style such as: font size, color, bold, italics, underlined, strike-through, etc.

The notations mentioned below are used to specify the needed formats:

Notations

Meaning

b

Bold

i

Italics

u

Underline

s

Strike-through

fs

Font size multiplied by 100.

fc

Font Color, and the color number is hexadecimal.

 

The text section should be enclosed with tags to specify the formatting. For example: <b>Hello World</b> will make the text "Hello World" to be bold.

If a style has an attribute like in the case of font size and font color, we add a colon to the opening tag and append the attribute after it, for example: <fs:1200>Hello World</fs> will set the text "Hello World" to a font size of 12.

Example

<fc:FF0000><fs:2400><u>Hello</u><i>W<s>or</s>l</i>d</fs></fc>

displays as:

TextRenderingMode

Defines various ways of rendering text to the display or printer.

Integer

0: Fill text

1: Stroke text

2 Fill, then stroke text

3: Neither fill nor stroke text (invisible)

0: Fill text

ClipPoints

Points that define the clip region.

Array of Points

 

NULL

ClipOps

Operations that define how the points are connected.

Array of enum IacPolyOps

0: acNoOp       

1: acCloseFigure      

2: acLineTo           

4: acBezierTo         

6: acMoveto           

16: acClip_Winding

32: acClip_Alternate

0: acNoOp

TextClipping

Show or do not show text that spills outside the rectangle.

Boolean

True/False

False

AutoResize

Automatically change the size of the text object to fit all its text.

Boolean

True/False

False

StrokeColor

The color of the stroke used to draw the text.

Color

COLORREF (bbggrr) 000000 to FFFFFF

or in COLORREF (aabbggrr) 00000000 to FFFFFFFF

000000 (Solid black)

StrokeWidth

The width of the stroke used to draw the text.

Float

 

1

StrokeStyle

The style of the stroke used to draw the text.

enum IacStrokeStyle

0: acStrokeStyleContinuous

1: acStrokeStyleDashed

2: acStrokeStyleDotted

0: acStrokeStyleContinuous

Styles

The first value specifies the length of the first dash in a user-defined style, the second value specifies the length of the first space, and so on.

Int Array

 

0

StylesF

Same Styles, but it use Float values more accurate.

Float Array

 

0

CanActivate

User can Activate.

Boolean

True/False

True

UpsideDown

Flips the text with its horizontal axis.

Boolean

True/False

False

FlipHorizontal

Flips the text with its vertical axis.

Boolean

True/False

False

Active

*ReadOnly

Object is Activate.

Boolean

True/False

False

RightToLeft

Reverses the text, backwards effect.

Boolean

True/False

False

 

Example

Public Sub Sample()
    'Constants for Activation codes
    Const strLicenseTo As String = "Amyuni PDF Creator .NET Evaluation"
    Const strActivationCode As String = "07EFCDAB0100010025C3B7B3DF579FF94C49112EAF736861254447237C2F6A215A53E83A9ECCFFE54C52063CB05338BDE555773D7B1B"
 
    'Initialize library
    'This should be done once
    acPDFCreatorLib.Initialize()
 
    'set license key This is needed only with licensed version
    acPDFCreatorLib.SetLicenseKey(strLicenseTo, strActivationCode)
 
    'Create a new PDF document
    Dim doc As New Amyuni.PDFCreator.IacDocument()
 
    'Create page object
    Dim page As Amyuni.PDFCreator.IacPage
 
    'Define first page of PDF document
    page = doc.GetPage(1)
 
    'Switch to design mode before adding objects to the document
    doc.ReportState = Amyuni.PDFCreator.IacReportState.acReportStateDesign
 
    'Create a Text
    With page.CreateObject(Amyuni.PDFCreator.IacObjectType.acObjectTypeText, "Text1")
        'General Attributes
        .Attribute("Left").Value = 1000        
        .Attribute("Right").Value = 3250
        .Attribute("Top").Value = 0
        .Attribute("Bottom").Value = 500
        'Text Attributes
        .Attribute("Text").Value = "Amyuni Technologies"
        .Attribute("Single line").Value = True
    End With
 
    'Refresh the PDF document
    doc.Refresh()
 
    'Switch to run mode after objects to the document
    doc.ReportState = Amyuni.PDFCreator.IacReportState.acReportStateRun
 
    'Create new stream object
    Dim fileWrite As System.IO.Stream = System.IO.File.OpenWrite("C:\temp\CreatePDFDocument_resulting.pdf")
 
    'Save stream
    doc.Save(fileWrite, Amyuni.PDFCreator.IacFileSaveOption.acFileSaveView)
 
    'Close the stream
    fileWrite.Close()
 
    'terminate library to free resources
    acPDFCreatorLib.Terminate()
 
    'destroy objects
    doc.Dispose()
    page.Dispose()
End Sub
public void Sample()
{
    // Constants for Activation codes
    const string strLicenseTo = "Amyuni PDF Creator .NET Evaluation";
    const string strActivationCode = "07EFCDAB0100010025C3B7B3DF579FF94C49112EAF736861254447237C2F6A215A53E83A9ECCFFE54C52063CB05338BDE555773D7B1B";
 
    // Initialize library
    // This should be done once
    acPDFCreatorLib.Initialize();
 
    // set license key This is needed only with licensed version
    acPDFCreatorLib.SetLicenseKey(strLicenseTo, strActivationCode);
 
    // Create a new PDF document
    Amyuni.PDFCreator.IacDocument doc = new Amyuni.PDFCreator.IacDocument();
 
    // Create page object
    Amyuni.PDFCreator.IacPage page;
 
    // Define first page of PDF document
    page = doc.GetPage(1);
 
    // Switch to design mode before adding objects to the document
    doc.ReportState = Amyuni.PDFCreator.IacReportState.acReportStateDesign;
 
    // Create a Text
    using (Amyuni.PDFCreator.IacObject oText = page.CreateObject(Amyuni.PDFCreator.IacObjectType.acObjectTypeText, "Text1"))
    {
        // General Attributes
        oText.Attribute("Left").Value = 1000;        
        oText.Attribute("Right").Value = 3250;
        oText.Attribute("Top").Value = 0;
        oText.Attribute("Bottom").Value = 500;
        // Text Attributes
        oText.Attribute("Text").Value = "Amyuni Technologies";
        oText.Attribute("Single line").Value = true;
    }
 
    // Switch to run mode after objects to the document
    doc.ReportState = Amyuni.PDFCreator.IacReportState.acReportStateRun;
 
    // Create new stream object
    System.IO.FileStream fileWrite = new System.IO.FileStream(@"C:\temp\CreatePDFDocument_resulting.pdf",
            System.IO.FileMode.Create,
            System.IO.FileAccess.Write,
            System.IO.FileShare.Read);
 
    // Save stream
    doc.Save(fileWrite, Amyuni.PDFCreator.IacFileSaveOption.acFileSaveView);
 
    // Close the stream
    fileWrite.Close();
 
    // terminate library to free resources
    acPDFCreatorLib.Terminate();
 
    // destroy objects
    doc.Dispose();
    page.Dispose();
}