IacAttribute Properties

 

Property

Description

Type

Values

Default Value

Value

Attribute value.

System.Object

 

NULL

Values

Possible values can be used by the attribute.  For example, enum values

System.String

0\ first value \1 second value...

NULL

Options

Options available.

System.UInt32

2 : Read-Only

8: Volatile

128: Static

 

HelpString

Information about the attribute.

System.String

 

 

 

Id

Global identifier.

System.UInt16

> = 0

 

Type

Data type of the attribute.

IacAttributeType enum

Int16 = 2,

Int32 = 3,

Single = 4,

Boolean = 11,

String = 14,

Format = 15,

Enum = 512,

Color = 513,

Font = 514,

File = 515,

Object = 516,

Data = 517,

CLSID = 518,

Field = 519,

Points = 520,

Array = 8192,

ObjArray = 8193,

FString = 8194,

ACString = 8196,

EnumSingle = 8197

 

Name

Attribute name.

string

 

 

 

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 text using AttributeByName

    With page.CreateObject(Amyuni.PDFCreator.IacObjectType.acObjectTypeText, "Text1")

        Dim attribute As IacAttribute = .AttributeByName("Left")

        attribute.Value = 1000

        attribute = .AttributeByName("Top")

        attribute.Value = 0

        attribute = .AttributeByName("Right")

        attribute.Value = 3250

        attribute = .AttributeByName("Bottom")

        attribute.Value = 500

        attribute = .AttributeByName("BackColor")

        attribute.Value = 192

        attribute = .AttributeByName("Hyperlink")

        attribute.Value = "http:// www.amyuni.com"

        attribute = .AttributeByName("Text")

        attribute.Value = "Amyuni Technologies"

    End With

    ' Create a text using Attribute

    With page.CreateObject(Amyuni.PDFCreator.IacObjectType.acObjectTypeText, "Text2")

        Dim attribute As IacAttribute = .Attribute("Left")

        attribute.Value = 1000

        attribute = .Attribute("Top")

        attribute.Value = 1000

        attribute = .Attribute("Right")

        attribute.Value = 3250

        attribute = .Attribute("Bottom")

        attribute.Value = 500

        attribute = .Attribute("BackColor")

        attribute.Value = 192

        attribute = .Attribute("Hyperlink")

        attribute.Value = "http:// www.amyuni.com"

        attribute = .Attribute("Text")

        attribute.Value = "Amyuni Technologies 2"

    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 text using AttributeByName

    using (Amyuni.PDFCreator.IacObject oText = page.CreateObject(Amyuni.PDFCreator.IacObjectType.acObjectTypeText, "Text1"))

    {

        IacAttribute attribute = oText.AttributeByName("Left");

        attribute.Value = 1000;

        attribute = oText.AttributeByName("Top");

        attribute.Value = 0;

        attribute = oText.AttributeByName("Right");

        attribute.Value = 3250;

        attribute = oText.AttributeByName("Bottom");

        attribute.Value = 500;

        attribute = oText.AttributeByName("BackColor");

        attribute.Value = 192;

        attribute = oText.AttributeByName("Hyperlink");

        attribute.Value = "http:// www.amyuni.com";

        attribute = oText.AttributeByName("Text");

        attribute.Value = "Amyuni Technologies";

    }

 

    // Create a text using Attribute

    using (Amyuni.PDFCreator.IacObject oText = page.CreateObject(Amyuni.PDFCreator.IacObjectType.acObjectTypeText, "Text2"))

    {

        IacAttribute attribute = oText.Attribute("Left");

        attribute.Value = 1000;

        attribute = oText.Attribute("Top");

        attribute.Value = 1000;

        attribute = oText.Attribute("Right");

        attribute.Value = 3250;

        attribute = oText.Attribute("Bottom");

        attribute.Value = 500;

        attribute = oText.Attribute("BackColor");

        attribute.Value = 192;

        attribute = oText.Attribute("Hyperlink");

        attribute.Value = "http:// www.amyuni.com";

        attribute = oText.Attribute("Text");

        attribute.Value = "Amyuni Technologies 2";

    }

 

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

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

}