Additional to the Common Attributes, this object has the following attributes:
Attribute Name |
Description |
Type |
Values |
Default Value |
|---|---|---|---|---|
Page |
Page Index where object is located. Page Number is Page Index + 1. |
Integer |
>= 0 |
0 |
Locked |
Object cannot be modified. This proprietary PDF Creator attribute works only with PDF Creator and files saved in Design or ViewAndDesign modes. |
Boolean |
True / False |
False |
ParentFullName |
The fully qualified name of this object' s parent object |
String |
||
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 COLORREF (aabbggrr) 00000000 to FFFFFFFF |
000000 (Solid black) |
BorderWidth |
Width of border around text. |
enum acBorderWidth Units are in points or 12th of an inch. |
0: acBorderWidthNone 1: acBorderWidthSimple 2: acBorderWidthDouble 3: acBorderWidthTriple 4: acBorderWidthQuadruple |
0: acBorderWidthNone |
BackColor |
Color for filling the background of Text object. |
Color |
COLORREF (bbggrr) 000000 to FFFFFF COLORREF (aabbggrr) 00000000 to FFFFFFFF |
FFFFFFFF (Transparent) |
TextColor |
Color for drawing text. |
Color |
COLORREF (bbggrr) 000000 to FFFFFF 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 acHorzAlign |
1: acHorzAlignLeft 2: acHorzAlignCenter 3: acHorzAlignRight 4: acHorzJustify |
1: acHorzAlignLeft |
Caption |
Button caption or title. (*) |
String |
NULL |
|
TextDown |
Caption or title of the button when it is pressed. |
String |
This property is specific to Acrobat Reader but has no effect in the PDF Creator. |
NULL |
TextOver |
Caption or title of the button when the cursor is placed over it. |
String |
This property is specific to Acrobat Reader but has no effect in the PDF Creator. |
NULL |
VertAlign |
Vertical text alignment. |
enum acVertAlign |
1: acVertAlignTop 2: acVertAlignCenter 3: acVertAlignBottom |
2: acVertAlignCenter |
TextPosition |
Text position. |
enum acTextPosition |
1: acTextPositionLeft 2: acTextPositionRight |
1: acTextPositionLeft |
Values |
It is the value that can be taken by the checkbox or RadioButton. |
String |
This should contain the various values that can be taken by a checkbox or radio-button. The two values should be separated by "OffVal\r\nOnVal". For example: "House\r\nTree" means that when the checkbox is cleared its Value attribute is "House", and it is "Tree" when checked. To change the state of a button we set the new value to the Text property in Design mode and the Value property in Run mode. |
Off/r/n/Yes |
Value |
Result of compiling the formula contained in the Text property. |
Text |
When the document is put in run mode, this contains the result of evaluating the Text property. |
NULL |
Text |
Formula or text to determine the state (Off / Yes, or the corresponding two values set in the Values attribute) of the CheckBox or RadioButton. |
Text |
The content of this property are evaluation and the result is put in the Value property. |
NULL |
Modified |
Indicates whether the object is modified and needs to be saved. |
Boolean |
True / False |
False |
Result |
Result of computing the expression in value |
String |
NULL |
|
ButtonType |
Type of button. |
enum acButtonType |
0: acCheckBox 1: acPushButton 2: acRadioButton |
0: acCheckBox |
AutoRadio |
Flag that indicates if clicking on a radio-button will check/uncheck the button. |
Boolean |
This property is specific to Acrobat Reader but has no effect in the PDF Creator. |
False |
LayerID |
ID layer which belongs the object. |
String |
||
XAML |
XAML representation of the object |
String |
||
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 acBlendMode |
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 |
(*) The user/developer will need to set the Caption explicitly after setting of "Text" attributes on a CheckBox or RadioButton field.
The "Value" attribute or the "Text" attribute can be used to change the value in the field. However, it is mandatory for "Text" attribute to set the report state to Run before saving the document in order to update the "Value" of the field internally from the "Text".
If we use the "Value" attribute, the value should be one that is present in the list of allowed "Values". By default for check-boxes, the list of allowed "Values" is "Off\r\nYes" for C/C++ or C# or "Off" & vbCrLf & "Yes" for VB VBScript.
Sub Sample()
' Constants for Activation codes
Const strLicenseTo As String = "Amyuni PDF Creator Evaluation"
Const strActivationCode As String = "07EFCDAB010001004282943FA0F69A88F332D9E7816403607A6D79A42847A1BDE06DB61C7EE94E2DC2424BF876238A335F9D3A84E9FC"
' Initializing PDFCreativeX Object
Dim pdf As ACPDFCREACTIVEX.PDFCreactiveX = New ACPDFCREACTIVEX.PDFCreactiveX()
' Set license key
pdf.SetLicenseKey(strLicenseTo, strActivationCode)
' Set CurrentPage
pdf.CurrentPage = 1
' RadioButton1 from Group1
pdf.CreateObject(ACPDFCREACTIVEX.ObjectTypeConstants.acObjectTypeCheckBox, "RadioButton1")
' Define Object
Dim oRadioButton As ACPDFCREACTIVEX.IacObject = pdf.GetObjectByName("RadioButton1.0")
' General Attributes
oRadioButton("Left") = 1000
oRadioButton("Right") = 1800
oRadioButton("Top") = 1000
oRadioButton("Bottom") = 1300
' RadioButton Attributes
oRadioButton("AutoRadio") = True
oRadioButton("ButtonType") = ACPDFCREACTIVEX.acButtonType.acButtonTypeRadiobutton
oRadioButton("BackColor") = &HFFFFFF
oRadioButton("BorderColor") = &H0
oRadioButton("BorderWidth") = ACPDFCREACTIVEX.acBorderWidth.acBorderWidthSimple
oRadioButton("ParentFullName") = "Group1"
oRadioButton("Value") = "Off"
' set values that radio button toggle
pdf.ObjectAttributeStr("Group1.0", "Values", "Off" + Environment.NewLine + "0")
' RadioButton2 from Group1
pdf.CreateObject(ACPDFCREACTIVEX.ObjectTypeConstants.acObjectTypeCheckBox, "RadioButton2")
' Define Object
oRadioButton = pdf.GetObjectByName("RadioButton2.0")
' General Attributes
oRadioButton("Left") = 2000
oRadioButton("Right") = 2800
oRadioButton("Top") = 1000
oRadioButton("Bottom") = 1300
' RadioButton Attributes
oRadioButton("AutoRadio") = True
oRadioButton("ButtonType") = ACPDFCREACTIVEX.acButtonType.acButtonTypeRadiobutton
oRadioButton("BackColor") = &HFFFFFF
oRadioButton("BorderColor") = &H0
oRadioButton("BorderWidth") = ACPDFCREACTIVEX.acBorderWidth.acBorderWidthSimple
oRadioButton("ParentFullName") = "Group1"
oRadioButton("Value") = "Off"
' set values that radio button toggle
pdf.ObjectAttributeStr("Group1.1", "Values", "Off" + Environment.NewLine + "1")
' RadioButton3 from Group1
pdf.CreateObject(ACPDFCREACTIVEX.ObjectTypeConstants.acObjectTypeCheckBox, "RadioButton3")
' Define Object
oRadioButton = pdf.GetObjectByName("RadioButton3.0")
' General Attributes
oRadioButton("Left") = 3000
oRadioButton("Right") = 3800
oRadioButton("Top") = 1000
oRadioButton("Bottom") = 1300
' RadioButton Attributes
oRadioButton("AutoRadio") = True
oRadioButton("ButtonType") = ACPDFCREACTIVEX.acButtonType.acButtonTypeRadiobutton
oRadioButton("BackColor") = &HFFFFFF
oRadioButton("BorderColor") = &H0
oRadioButton("BorderWidth") = ACPDFCREACTIVEX.acBorderWidth.acBorderWidthSimple
oRadioButton("ParentFullName") = "Group1"
oRadioButton("Value") = "Off"
' set values that radio button toggle
pdf.ObjectAttributeStr("Group1.2", "Values", "Off" + Environment.NewLine + "2")
' RadioButtonA from Group2
pdf.CreateObject(ACPDFCREACTIVEX.ObjectTypeConstants.acObjectTypeCheckBox, "RadioButtonA")
' Define Object
oRadioButton = pdf.GetObjectByName("RadioButtonA.0")
' General Attributes
oRadioButton("Left") = 1000
oRadioButton("Right") = 2500
oRadioButton("Top") = 2000
oRadioButton("Bottom") = 2300
' RadioButton Attributes
oRadioButton("AutoRadio") = True
oRadioButton("ButtonType") = ACPDFCREACTIVEX.acButtonType.acButtonTypeRadiobutton
oRadioButton("BackColor") = &HFFFFFF
oRadioButton("BorderColor") = &H0
oRadioButton("BorderWidth") = ACPDFCREACTIVEX.acBorderWidth.acBorderWidthSimple
oRadioButton("ParentFullName") = "Group2"
oRadioButton("Value") = "Off"
' set values that radio button toggle
pdf.ObjectAttributeStr("Group2.0", "Values", "Off" + Environment.NewLine + "Green")
' RadioButtonB from Group2
pdf.CreateObject(ACPDFCREACTIVEX.ObjectTypeConstants.acObjectTypeCheckBox, "RadioButtonB")
' Define Object
oRadioButton = pdf.GetObjectByName("RadioButtonB.0")
' General Attributes
oRadioButton("Left") = 3000
oRadioButton("Right") = 4500
oRadioButton("Top") = 2000
oRadioButton("Bottom") = 2300
' RadioButton Attributes
oRadioButton("AutoRadio") = True
oRadioButton("ButtonType") = ACPDFCREACTIVEX.acButtonType.acButtonTypeRadiobutton
oRadioButton("BackColor") = &HFFFFFF
oRadioButton("BorderColor") = &H0
oRadioButton("BorderWidth") = ACPDFCREACTIVEX.acBorderWidth.acBorderWidthSimple
oRadioButton("ParentFullName") = "Group2"
oRadioButton("Value") = "Red"
' set values that radio button toggle
pdf.ObjectAttributeStr("Group2.1", "Values", "Off" + Environment.NewLine + "Red")
' Save PDF
pdf.Save("c:\temp\CreatePDFDocument_resulting.pdf", ACPDFCREACTIVEX.FileSaveOptionConstants.acFileSaveView)
End Sub
static void Sample()
{
// Constants for Activation codes
const string strLicenseTo = "Amyuni PDF Creator Evaluation";
const string strActivationCode = "07EFCDAB010001004282943FA0F69A88F332D9E7816403607A6D79A42847A1BDE06DB61C7EE94E2DC2424BF876238A335F9D3A84E9FC";
// Initializing PDFCreativeX Object
ACPDFCREACTIVEX.PDFCreactiveX pdf = new ACPDFCREACTIVEX.PDFCreactiveX();
// Set license key
pdf.SetLicenseKey(strLicenseTo, strActivationCode);
// Set CurrentPage
pdf.CurrentPage = 1;
// RadioButton1 from Group1
pdf.CreateObject(ACPDFCREACTIVEX.ObjectTypeConstants.acObjectTypeCheckBox, "RadioButton1");
// Define Object
ACPDFCREACTIVEX.IacObject oRadioButton = pdf.GetObjectByName("RadioButton1.0");
// General Attributes
oRadioButton["Left"] = 1000;
oRadioButton["Right"] = 1800;
oRadioButton["Top"] = 1000;
oRadioButton["Bottom"] = 1300;
// oRadioButton Attributes
oRadioButton["AutoRadio"] = true;
oRadioButton["ButtonType"] = ACPDFCREACTIVEX.acButtonType.acButtonTypeRadiobutton;
oRadioButton["BackColor"] = 0xFFFFFF;
oRadioButton["BorderColor"] = 0x0;
oRadioButton["BorderWidth"] = ACPDFCREACTIVEX.acBorderWidth.acBorderWidthSimple;
oRadioButton["ParentFullName"] = "Group1";
oRadioButton["Value"] = "Off";
// set values that radio button toggle
pdf.ObjectAttributeStr("Group1.0", "Values", "Off" + Environment.NewLine + "0");
// RadioButton2 from Group1
pdf.CreateObject(ACPDFCREACTIVEX.ObjectTypeConstants.acObjectTypeCheckBox, "RadioButton2");
// Define Object
oRadioButton = pdf.GetObjectByName("RadioButton2.0");
// General Attributes
oRadioButton["Left"] = 2000;
oRadioButton["Right"] = 2800;
oRadioButton["Top"] = 1000;
oRadioButton["Bottom"] = 1300;
// oRadioButton Attributes
oRadioButton["AutoRadio"] = true;
oRadioButton["ButtonType"] = ACPDFCREACTIVEX.acButtonType.acButtonTypeRadiobutton;
oRadioButton["BackColor"] = 0xFFFFFF;
oRadioButton["BorderColor"] = 0x0;
oRadioButton["BorderWidth"] = ACPDFCREACTIVEX.acBorderWidth.acBorderWidthSimple;
oRadioButton["ParentFullName"] = "Group1";
oRadioButton["Value"] = "Off";
// set values that radio button toggle
pdf.ObjectAttributeStr("Group1.1", "Values", "Off" + Environment.NewLine + "1");
// RadioButton3 from Group1
pdf.CreateObject(ACPDFCREACTIVEX.ObjectTypeConstants.acObjectTypeCheckBox, "RadioButton3");
// Define Object
oRadioButton = pdf.GetObjectByName("RadioButton3.0");
// General Attributes
oRadioButton["Left"] = 3000;
oRadioButton["Right"] = 3800;
oRadioButton["Top"] = 1000;
oRadioButton["Bottom"] = 1300;
// oRadioButton Attributes
oRadioButton["AutoRadio"] = true;
oRadioButton["ButtonType"] = ACPDFCREACTIVEX.acButtonType.acButtonTypeRadiobutton;
oRadioButton["BackColor"] = 0xFFFFFF;
oRadioButton["BorderColor"] = 0x0;
oRadioButton["BorderWidth"] = ACPDFCREACTIVEX.acBorderWidth.acBorderWidthSimple;
oRadioButton["ParentFullName"] = "Group1";
oRadioButton["Value"] = "Off";
// set values that radio button toggle
pdf.ObjectAttributeStr("Group1.2", "Values", "Off" + Environment.NewLine + "2");
// RadioButtonA from Group2
pdf.CreateObject(ACPDFCREACTIVEX.ObjectTypeConstants.acObjectTypeCheckBox, "RadioButtonA");
// Define Object
oRadioButton = pdf.GetObjectByName("RadioButtonA.0");
// General Attributes
oRadioButton["Left"] = 1000;
oRadioButton["Right"] = 2500;
oRadioButton["Top"] = 2000;
oRadioButton["Bottom"] = 2300;
// oRadioButton Attributes
oRadioButton["AutoRadio"] = true;
oRadioButton["ButtonType"] = ACPDFCREACTIVEX.acButtonType.acButtonTypeRadiobutton;
oRadioButton["BackColor"] = 0xFFFFFF;
oRadioButton["BorderColor"] = 0x0;
oRadioButton["BorderWidth"] = ACPDFCREACTIVEX.acBorderWidth.acBorderWidthSimple;
oRadioButton["ParentFullName"] = "Group2";
oRadioButton["Value"] = "Off";
// set values that radio button toggle
pdf.ObjectAttributeStr("Group2.0", "Values", "Off" + Environment.NewLine + "Green");
// RadioButtonB from Group2
pdf.CreateObject(ACPDFCREACTIVEX.ObjectTypeConstants.acObjectTypeCheckBox, "RadioButtonB");
// Define Object
oRadioButton = pdf.GetObjectByName("RadioButtonB.0");
// General Attributes
oRadioButton["Left"] = 3000;
oRadioButton["Right"] = 4500;
oRadioButton["Top"] = 2000;
oRadioButton["Bottom"] = 2300;
// oRadioButton Attributes
oRadioButton["AutoRadio"] = true;
oRadioButton["ButtonType"] = ACPDFCREACTIVEX.acButtonType.acButtonTypeRadiobutton;
oRadioButton["BackColor"] = 0xFFFFFF;
oRadioButton["BorderColor"] = 0x0;
oRadioButton["BorderWidth"] = ACPDFCREACTIVEX.acBorderWidth.acBorderWidthSimple;
oRadioButton["ParentFullName"] = "Group2";
oRadioButton["Value"] = "Red";
// set values that radio button toggle
pdf.ObjectAttributeStr("Group2.1", "Values", "Off" + Environment.NewLine + "Red");
// Save PDF
pdf.Save(@"c:\temp\CreatePDFDocument_resulting.pdf", ACPDFCREACTIVEX.FileSaveOptionConstants.acFileSaveView);
}
#import "c:\users\amyuni\pdfcreactivex.dll" no_namespace
using namespace std;
int main()
{
// Constants for Activation codes
bstr_t strLicenseTo = "Amyuni PDF Creator Evaluation";
bstr_t strActivationCode = "07EFCDAB010001004282943FA0F69A88F332D9E7816403607A6D79A42847A1BDE06DB61C7EE94E2DC2424BF876238A335F9D3A84E9FC";
// Initialize the COM subsystem
CoInitialize(0);
// IPDFCreactiveXPtr is a smart pointer type defined in pdfcreactivex.tlh,
// the type library header file generated by the #import instruction above
IPDFCreactiveXPtr pdf;
// Create the PDFCreactiveX instance
pdf.CreateInstance(__uuidof(PDFCreactiveX));
// set license key
pdf->SetLicenseKey(_bstr_t(strLicenseTo), _bstr_t(strActivationCode));
// Set CurrentPage
pdf->CurrentPage = 1;
// RadioButton1 from Group1
pdf->CreateObject(acObjectTypeCheckBox, "RadioButton1");
// Define Object
IacObjectPtr oRadioButton = pdf->GetObjectByName("RadioButton1.0");
// General Attributes
oRadioButton->Attribute["Left"] = 1000;
oRadioButton->Attribute["Right"] = 1800;
oRadioButton->Attribute["Top"] = 1000;
oRadioButton->Attribute["Bottom"] = 1300;
// oRadioButton Attributes
oRadioButton->Attribute["AutoRadio"] = true;
_variant_t varAttribute;
varAttribute.vt = VT_I4; // integers
varAttribute.lVal = acButtonTypeRadiobutton;
oRadioButton->Attribute["ButtonType"] = varAttribute;
varAttribute.lVal = 0xFFFFFF;
oRadioButton->Attribute["BorderColor"] = varAttribute;
varAttribute.lVal = 0x0;
oRadioButton->Attribute["BorderColor"] = varAttribute;
varAttribute.lVal = acBorderWidthSimple;
oRadioButton->Attribute["BorderWidth"] = varAttribute;
oRadioButton->Attribute["ParentFullName"] = "Group1";
oRadioButton->Attribute["Value"] = "Off";
// set values that radio button toggle
pdf->ObjectAttributeStr("Group1.0", "Values", "Off\r\n0");
// RadioButton2 from Group1
pdf->CreateObject(acObjectTypeCheckBox, "RadioButton2");
// Define Object
oRadioButton = pdf->GetObjectByName("RadioButton2.0");
// General Attributes
oRadioButton->Attribute["Left"] = 2000;
oRadioButton->Attribute["Right"] = 2800;
oRadioButton->Attribute["Top"] = 1000;
oRadioButton->Attribute["Bottom"] = 1300;
// oRadioButton Attributes
oRadioButton->Attribute["AutoRadio"] = true;
varAttribute.vt = VT_I4; // integers
varAttribute.lVal = acButtonTypeRadiobutton;
oRadioButton->Attribute["ButtonType"] = varAttribute;
varAttribute.lVal = 0xFFFFFF;
oRadioButton->Attribute["BorderColor"] = varAttribute;
varAttribute.lVal = 0x0;
oRadioButton->Attribute["BorderColor"] = varAttribute;
varAttribute.lVal = acBorderWidthSimple;
oRadioButton->Attribute["BorderWidth"] = varAttribute;
oRadioButton->Attribute["ParentFullName"] = "Group1";
oRadioButton->Attribute["Value"] = "Off";
// set values that radio button toggle
pdf->ObjectAttributeStr("Group1.1", "Values", "Off\r\n1");
// RadioButton3 from Group1
pdf->CreateObject(acObjectTypeCheckBox, "RadioButton3");
// Define Object
oRadioButton = pdf->GetObjectByName("RadioButton3.0");
// General Attributes
oRadioButton->Attribute["Left"] = 3000;
oRadioButton->Attribute["Right"] = 3800;
oRadioButton->Attribute["Top"] = 1000;
oRadioButton->Attribute["Bottom"] = 1300;
// oRadioButton Attributes
oRadioButton->Attribute["AutoRadio"] = true;
varAttribute.vt = VT_I4; // integers
varAttribute.lVal = acButtonTypeRadiobutton;
oRadioButton->Attribute["ButtonType"] = varAttribute;
varAttribute.lVal = 0xFFFFFF;
oRadioButton->Attribute["BorderColor"] = varAttribute;
varAttribute.lVal = 0x0;
oRadioButton->Attribute["BorderColor"] = varAttribute;
varAttribute.lVal = acBorderWidthSimple;
oRadioButton->Attribute["BorderWidth"] = varAttribute;
oRadioButton->Attribute["ParentFullName"] = "Group1";
oRadioButton->Attribute["Value"] = "Off";
// set values that radio button toggle
pdf->ObjectAttributeStr("Group1.2", "Values", "Off\r\n2");
// RadioButtonA from Group2
pdf->CreateObject(acObjectTypeCheckBox, "RadioButtonA");
// Define Object
oRadioButton = pdf->GetObjectByName("RadioButtonA.0");
// General Attributes
oRadioButton->Attribute["Left"] = 1000;
oRadioButton->Attribute["Right"] = 2500;
oRadioButton->Attribute["Top"] = 2000;
oRadioButton->Attribute["Bottom"] = 2300;
// oRadioButton Attributes
oRadioButton->Attribute["AutoRadio"] = true;
varAttribute.vt = VT_I4; // integers
varAttribute.lVal = acButtonTypeRadiobutton;
oRadioButton->Attribute["ButtonType"] = varAttribute;
varAttribute.lVal = 0xFFFFFF;
oRadioButton->Attribute["BorderColor"] = varAttribute;
varAttribute.lVal = 0x0;
oRadioButton->Attribute["BorderColor"] = varAttribute;
varAttribute.lVal = acBorderWidthSimple;
oRadioButton->Attribute["BorderWidth"] = varAttribute;
oRadioButton->Attribute["ParentFullName"] = "Group2";
oRadioButton->Attribute["Value"] = "Off";
// set values that radio button toggle
pdf->ObjectAttributeStr("Group2.0", "Values", "Off\r\nGreen");
// RadioButtonB from Group2
pdf->CreateObject(acObjectTypeCheckBox, "RadioButtonB");
// Define Object
oRadioButton = pdf->GetObjectByName("RadioButtonB.0");
// General Attributes
oRadioButton->Attribute["Left"] = 3000;
oRadioButton->Attribute["Right"] = 4500;
oRadioButton->Attribute["Top"] = 2000;
oRadioButton->Attribute["Bottom"] = 2300;
// oRadioButton Attributes
oRadioButton->Attribute["AutoRadio"] = true;
varAttribute.vt = VT_I4; // integers
varAttribute.lVal = acButtonTypeRadiobutton;
oRadioButton->Attribute["ButtonType"] = varAttribute;
varAttribute.lVal = 0xFFFFFF;
oRadioButton->Attribute["BorderColor"] = varAttribute;
varAttribute.lVal = 0x0;
oRadioButton->Attribute["BorderColor"] = varAttribute;
varAttribute.lVal = acBorderWidthSimple;
oRadioButton->Attribute["BorderWidth"] = varAttribute;
oRadioButton->Attribute["ParentFullName"] = "Group2";
oRadioButton->Attribute["Value"] = "Red";
// set values that radio button toggle
pdf->ObjectAttributeStr("Group2.1", "Values", "Off\r\nRed");
// Save PDF
pdf->Save("c:\\temp\\CreatePDFDocument_resulting.pdf", acFileSaveView);
// destroy objects
pdf = NULL;
oRadioButton = NULL;
return 0;
}
' acButtonType Constants
Const acButtonTypeCheckBox = 0
Const acButtonTypePushButton = 1
Const acButtonTypeRadiobutton = 2
' acHorzAling Constants
Const acHorzAlignLeft = 1
Const acHorzAlignCenter = 2
Const acHorzAlignRight = 3
Const acHorzJustify = 4
' acVertAlign Constants
Const acVertAlignTop = 1
Const acVertAlignCenter = 2
Const acVertAlignBottom = 3
' acBorderWidth Constants
Const acBorderWidthNone = 0
Const acBorderWidthSimple = 1
Const acBorderWidthDouble = 2
Const acBorderWidthTriple = 3
Const acBorderWidthQuadruple = 4
' ObjectTypeConstants
Const acObjectTypeArrow = 36
Const acObjectTypeBarcode = 45
Const acObjectTypeCell = 33
Const acObjectTypeCheckBox = 21
Const acObjectTypeEllipse = 4
Const acObjectTypeExcel = 17
Const acObjectTypeField = 6
Const acObjectTypeGraph = 19
Const acObjectTypeHighlight = 23
Const acObjectTypeLine = 1
Const acObjectTypePicture = 7
Const acObjectTypePolygon = 8
Const acObjectTypeRoundFrame = 3
Const acObjectTypeRow = 32
Const acObjectTypeSelection = 24
Const acObjectTypeSignature = 39
Const acObjectTypeStickyNote = 22
Const acObjectTypeTable = 16
Const acObjectTypeText = 5
' FileSaveOptionConstants
Const acFileSaveAll = 0
Const acFileSaveDefault = -1
Const acFileSaveView = 1
Const acFileSaveDesign = 2
Const acFileSavePDFA_7 = 3
Const acFileSavePDFA = 4
Const acFileSavePDF14 = 5
' Constants for Activation codes
Const strLicenseTo = "Amyuni PDF Creator Evaluation"
Const strActivationCode = "07EFCDAB010001004282943FA0F69A88F332D9E7816403607A6D79A42847A1BDE06DB61C7EE94E2DC2424BF876238A335F9D3A84E9FC"
' Initializing PDFCreativeX Object
Dim pdf
Set pdf = CreateObject("PDFCreactiveX.PDFCreactiveX.6.0")
' Set license key
pdf.SetLicenseKey strLicenseTo, strActivationCode
' Set CurrentPage
pdf.CurrentPage = 1
' RadioButton1 from Group1
pdf.CreateObject acObjectTypeCheckBox, "RadioButton1"
' Define Object
Dim oRadioButton
Set oRadioButton = pdf.GetObjectByName("RadioButton1.0")
' General Attributes
oRadioButton("Left") = 1000
oRadioButton("Right") = 1800
oRadioButton("Top") = 1000
oRadioButton("Bottom") = 1300
' RadioButton Attributes
oRadioButton("AutoRadio") = True
oRadioButton("ButtonType") = acButtonTypeRadiobutton
oRadioButton("BackColor") = &HFFFFFF
oRadioButton("BorderColor") = &H000000
oRadioButton("BorderWidth") = acBorderWidthSimple
oRadioButton("ParentFullName") = "Group1"
oRadioButton("Value") = "Off"
' set values that radio button toggle
pdf.ObjectAttributeStr "Group1.0", "Values", "Off"+ VbCr + "0"
' RadioButton2 from Group1
pdf.CreateObject acObjectTypeCheckBox, "RadioButton2"
' Define Object
Set oRadioButton = pdf.GetObjectByName("RadioButton2.0")
' General Attributes
oRadioButton("Left") = 2000
oRadioButton("Right") = 2800
oRadioButton("Top") = 1000
oRadioButton("Bottom") = 1300
' RadioButton Attributes
oRadioButton("AutoRadio") = True
oRadioButton("ButtonType") = acButtonTypeRadiobutton
oRadioButton("BackColor") = &HFFFFFF
oRadioButton("BorderColor") = &H000000
oRadioButton("BorderWidth") = acBorderWidthSimple
oRadioButton("ParentFullName") = "Group1"
oRadioButton("Value") = "Off"
' set values that radio button toggle
pdf.ObjectAttributeStr "Group1.1", "Values", "Off"+ VbCr + "1"
' RadioButton3 from Group1
pdf.CreateObject acObjectTypeCheckBox, "RadioButton3"
' Define Object
Set oRadioButton = pdf.GetObjectByName("RadioButton3.0")
' General Attributes
oRadioButton("Left") = 3000
oRadioButton("Right") = 3800
oRadioButton("Top") = 1000
oRadioButton("Bottom") = 1300
' RadioButton Attributes
oRadioButton("AutoRadio") = True
oRadioButton("ButtonType") = acButtonTypeRadiobutton
oRadioButton("BackColor") = &HFFFFFF
oRadioButton("BorderColor") = &H000000
oRadioButton("BorderWidth") = acBorderWidthSimple
oRadioButton("ParentFullName") = "Group1"
oRadioButton("Value") = "Off"
' set values that radio button toggle
pdf.ObjectAttributeStr "Group1.2", "Values", "Off"+ VbCr + "2"
' RadioButtonA from Group2
pdf.CreateObject acObjectTypeCheckBox, "RadioButtonA"
' Define Object
Set oRadioButton = pdf.GetObjectByName("RadioButtonA.0")
' General Attributes
oRadioButton("Left") = 1000
oRadioButton("Right") = 1800
oRadioButton("Top") = 2000
oRadioButton("Bottom") = 2300
' RadioButton Attributes
oRadioButton("AutoRadio") = True
oRadioButton("ButtonType") = acButtonTypeRadiobutton
oRadioButton("BackColor") = &HFFFFFF
oRadioButton("BorderColor") = &H000000
oRadioButton("BorderWidth") = acBorderWidthSimple
oRadioButton("ParentFullName") = "Group2"
oRadioButton("Value") = "Off"
' set values that radio button toggle
pdf.ObjectAttributeStr "Group2.0", "Values", "Off"+ VbCr + "Green"
' RadioButtonB from Group2
pdf.CreateObject acObjectTypeCheckBox, "RadioButtonB"
' Define Object
Set oRadioButton = pdf.GetObjectByName("RadioButtonB.0")
' General Attributes
oRadioButton("Left") = 2000
oRadioButton("Right") = 2800
oRadioButton("Top") = 2000
oRadioButton("Bottom") = 2300
' RadioButton Attributes
oRadioButton("AutoRadio") = True
oRadioButton("ButtonType") = acButtonTypeRadiobutton
oRadioButton("BackColor") = &HFFFFFF
oRadioButton("BorderColor") = &H000000
oRadioButton("BorderWidth") = acBorderWidthSimple
oRadioButton("ParentFullName") = "Group2"
oRadioButton("Value") = "Red"
' set values that radio button toggle
pdf.ObjectAttributeStr "Group2.1", "Values", "Off"+ VbCr + "Red"
' Save PDF
pdf.Save "c:\temp\CreatePDFDocument_resulting.pdf", acFileSaveView
' destroy Objects
Set pdf = Nothing
Set oCheckBox = Nothing
Set oRadioButton = Nothing
Set oPushButton = Nothing