I have three signature fields in my PDF. I am taking values from a ComboBox
in my Windows Forms apps for this.
The ComboBox
has:
Signature 1
Signature 2
Signature 3
For the signature fields, I have a property:
field.fullname;
field.baseobject;
Which gives me the full name of the field, e.g.
Signature 1
...
I want to compare these two on the Click of the Save button; that is, if signature field 1 is selected, the data should be added to the signature field1 only, and so on.
How do I do this?
I tried using field.BasedataObject
, and I found the following
<24 0 R> - 1st field
<26 0 R> - 2nd field
<1010 0 R> - 3rd field
It looks like a simple solution would be to create a class for Signature (using your necessary properties) then create an array of signatures. Use that array of Signatures to populate your combobox in the first place (maintaining integrity of your system) then use the id from selected value of the combobox to compare to the array index. Something like this:
public class Signature{
string property1;
string property2;
public Signature(string propertyVal1, string propertyVal2)
{
property1 = propertyVal1;
property2 = propertyVal2;
}
}
Signature[] mySignatures = new Signature[3];
public Form1()
{
InitializeComponent();
mySignatures[0] = new Signature("hello", "world");
mySignatures[1] = new Signature("hello", "world");
mySignatures[2] = new Signature("hello", "world");
for (int i = 0; i < mySignatures.Length; i++)
{
comboBox1.Items.Add(mySignatures[i]);
}
}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With