Selection Object Attributes(Combo-box, List-box)

 

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

Attribute Name

Description

Type

Values

Default Value

ParentFullName

The fully qualified name of this object' s parent object

String

   

Page

Page Index where object is located.  Page Number is Page Index + 1.

Integer

>= 0

0

Locked

Object cannot be modified

Boolean

True / False

False

Left

Left position in Twips

Integer

 

0

Top

Top position in Twips

Integer

 

0

Right

Right position in Twips

Integer

 

0

Bottom

Bottom position in Twips

Integer

 

0

LeftF

Left position in Twips

Float

 

0.00F

TopF

Top position in Twips

Float

 

0.00F

RightF

Right position in Twips

Float

 

0.00F

BottomF

Bottom position in Twips

Float

 

0.00F

Visible

Object is visible when document is printed

Boolean

True / False

True

Editable

Standard PDF attribute that makes the object editable or not in any viewer.

Boolean

True / False

True

CanActivate

User can Activate.

Boolean

True/False

True

Hidden

Hidden in certain report states

Integer

A binary combination of the following values:

1: Hidden in Run mode

2: Hidden in Design mode

4: Reserved value

8: Hidden in Print preview

16: Hidden in Annotation mode

0: Always visible

Annotation

Object is saved as an annotation as opposed to a drawing within the page contents

Boolean

True / False

False for static objects such as lines, polygons and text. True for dynamic objects such as form fields or high-lighters

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

0: acBorderWidthNone

1: acBorderWidthSimple

2: acBorderWidthDouble

3: acBorderWidthTriple

4: acBorderWidthQuadruple

Units are in points or 12th of an inch.

1: acBorderWidthSimple

BackColor

 

Color for filling the background of Text object.

Color

COLORREF (bbggrr) 000000 to FFFFFF

or in COLORREF (aabbggrr) 00000000 to FFFFFFFF

FFFFFF (Solid white)

TextColor

Color for drawing text.

Color

COLORREF (bbggrr) 000000 to FFFFFF

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

NULL

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

Text

String of text contained in object.

String

 

NULL

LayerID

ID layer which belongs the object.

String

   

Values

List of values shown in the selection box.

String

 

 

SelectionType

 

enum IacSelectionType

0: acListBox

1: acComboBox

0: acListBox

EditBox

Sets the text in selection list editable.

Boolean

True / False

False

BlendMode  

Blends the color object according to a define mode. This blending is also applied to the object when it is saved or printed.

enum IacBlendMode

0: acBlendModeNormal

1: acBlendModeMultiply

2: acBlendModeScreen

3: acBlendModeOverlay

4 : acBlendModeDarken

5: acBlendModeLighten

6: acBlendModeColorDodge

7: acBlendModeColorBurn

8: acBlendModeHardLight

9: acBlendModeSoftLight

10: acBlendModeDifference

11: acBlendModeExclusion

12 : acBlendModeHue

13: acBlendModeSaturation

14 : acBlendModeColor

15: acBlendModeLuminosity

16: acBlendModeCompatible

0: acBlendModeNormal

 

Example

Public Sub Sample()

    ' Constants for Activation codes

    Const strLicenseTo As String = "Amyuni PDF Creator .NET Evaluation"

    Const strActivationCode As String = "07EFCDAB0100010025C3B7B351579FF94C49112EAF7368612744C7237C2F6A215A53E83A9ECCFFE54C52063CB05338BDE555773D7B1B"

 

    ' 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 ListBox

    With page.CreateObject(Amyuni.PDFCreator.IacObjectType.acObjectTypeSelection, "ListBox1")

        ' General Attributes

        .Attribute("Left").Value = 1000        

        .Attribute("Right").Value = 3250

        .Attribute("Top").Value = 0

        .Attribute("Bottom").Value = 1500

        ' ListBox Attributes

        .Attribute("SelectionType").Value = Amyuni.PDFCreator.IacSelectionType.acListBox

        .Attribute("Values").Value = "one" + Environment.NewLine + "two" + Environment.NewLine +

            "three" + Environment.NewLine + "four"

        .Attribute("BorderColor").Value = &HFF00FF

        .Attribute("BorderWidth").Value = Amyuni.PDFCreator.IacBorderWidth.acBorderWidthTriple

        .Attribute("Text").Value = "Amyuni Technologies"

        .Attribute("HorzAlign").Value = Amyuni.PDFCreator.IacHorzAlign.acHorzAlignCenter

        .Attribute("VertAlign").Value = Amyuni.PDFCreator.IacVertAlign.acVertAlignCenter

    End With

 

    ' Create a ComboBox

    With page.CreateObject(Amyuni.PDFCreator.IacObjectType.acObjectTypeSelection, "ComboBox1")

        ' General Attributes

        .Attribute("Left").Value = 1000        

        .Attribute("Right").Value = 3250

        .Attribute("Top").Value = 2000

        .Attribute("Bottom").Value = 2500

        ' ComboBox Attributes

        .Attribute("SelectionType").Value = Amyuni.PDFCreator.IacSelectionType.acComboBox

        .Attribute("Values").Value = "one" + Environment.NewLine + "two" + Environment.NewLine +

            "three" + Environment.NewLine + "four" + Environment.NewLine + "five"

        .Attribute("BorderColor").Value = &HFF00FF

        .Attribute("BorderWidth").Value = Amyuni.PDFCreator.IacBorderWidth.acBorderWidthTriple

        .Attribute("Text").Value = "Amyuni Technologies"

        .Attribute("HorzAlign").Value = Amyuni.PDFCreator.IacHorzAlign.acHorzAlignCenter

        .Attribute("VertAlign").Value = Amyuni.PDFCreator.IacVertAlign.acVertAlignCenter

    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 = "07EFCDAB0100010025C3B7B351579FF94C49112EAF7368612744C7237C2F6A215A53E83A9ECCFFE54C52063CB05338BDE555773D7B1B";

 

    // 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 ListBox

    using (Amyuni.PDFCreator.IacObject oListBox = page.CreateObject(Amyuni.PDFCreator.IacObjectType.acObjectTypeSelection, "ListBox1"))

    {

        // General Attributes

        oListBox.Attribute("Left").Value = 1000;

        oListBox.Attribute("Top").Value = 0;

        oListBox.Attribute("Right").Value = 3250;

        oListBox.Attribute("Bottom").Value = 1500;

        // ListBox Attributes

        oListBox.Attribute("SelectionType").Value = Amyuni.PDFCreator.IacSelectionType.acListBox;

        oListBox.Attribute("Values").Value = "one" + Environment.NewLine + "two" + Environment.NewLine +

            "three" + Environment.NewLine + "four";

        oListBox.Attribute("BorderColor").Value = 0xFF00FF;

        oListBox.Attribute("BorderWidth").Value = Amyuni.PDFCreator.IacBorderWidth.acBorderWidthTriple;

        oListBox.Attribute("Text").Value = "Amyuni Technologies";

        oListBox.Attribute("HorzAlign").Value = Amyuni.PDFCreator.IacHorzAlign.acHorzAlignCenter;

        oListBox.Attribute("VertAlign").Value = Amyuni.PDFCreator.IacVertAlign.acVertAlignCenter;

    }

 

    // Create a ComboBox

    using (Amyuni.PDFCreator.IacObject oComboBox = page.CreateObject(Amyuni.PDFCreator.IacObjectType.acObjectTypeSelection, "ComboBox1"))

    {

        // General Attributes

        oComboBox.Attribute("Left").Value = 1000;

        oComboBox.Attribute("Top").Value = 2000;

        oComboBox.Attribute("Right").Value = 3250;

        oComboBox.Attribute("Bottom").Value = 2500;

        // ListBox Attributes

        oComboBox.Attribute("SelectionType").Value = Amyuni.PDFCreator.IacSelectionType.acComboBox;

        oComboBox.Attribute("Values").Value = "one" + Environment.NewLine + "two" + Environment.NewLine +

            "three" + Environment.NewLine + "four" + Environment.NewLine + "five";

        oComboBox.Attribute("BorderColor").Value = 0xFF00FF;

        oComboBox.Attribute("BorderWidth").Value = Amyuni.PDFCreator.IacBorderWidth.acBorderWidthTriple;

        oComboBox.Attribute("Text").Value = "Amyuni Technologies";

        oComboBox.Attribute("HorzAlign").Value = Amyuni.PDFCreator.IacHorzAlign.acHorzAlignCenter;

        oComboBox.Attribute("VertAlign").Value = Amyuni.PDFCreator.IacVertAlign.acVertAlignCenter;

    }

 

    // 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();

}