Signin/Signup with: 
Welcome, Guest
Username: Password: Remember me
Development and suggestions about third part tool integration.
Cordova, Xamarin, Basic4Android topics are listed here.
  • Page:
  • 1

TOPIC:

Checkbox Value 5 years 10 months ago #13915

  • mfranc28
  • mfranc28's Avatar Topic Author
  • Offline
  • Junior Member
  • Junior Member
  • Posts: 25
  • Thank you received: 0
Greetings, anyone know how can I get the value of the checkbox? I don't mean "check status" but the real value, like for example the value of a label.

I need so because I have a PDF Form with a couple of checkbox with same name but different value so when I check one of this I need to save the corrispettive value not it's check status.

Thanks

Please Log in or Create an account to join the conversation.

Checkbox Value 5 years 10 months ago #13916

  • Davide
  • Davide's Avatar
  • Offline
  • User is blocked
  • User is blocked
  • Posts: 814
  • Thank you received: 65
Hi,
can you please send us a sample pdf so we can check it?
Please give us the value you expect to get from the checkbox?

Please Log in or Create an account to join the conversation.

Checkbox Value 5 years 10 months ago #13920

  • mfranc28
  • mfranc28's Avatar Topic Author
  • Offline
  • Junior Member
  • Junior Member
  • Posts: 25
  • Thank you received: 0
Hi Davide,
my colleague have make this code under Android Native for radio for get the export value but in Xamarin don't work, probably some method are not exposed in SDK (for ex. Advance_GetRef())? I think it's same logic also for check....

public String GetRadaeeRadioValue(Document m_doc)
{
Obj obj = m_doc.Advance_GetObj(Advance_GetRef());
if (obj != null)
{
try
{
Obj item = obj.DictGetItem("AP");

if (item != null)
{
int type = item.GetType();
String type_name = get_type_name(type);

if ("dictionary".equals(type_name))
{
item = item.DictGetItem("D");

if (item != null)
{
String value = item.DictGetItemTag(0);
if (value != null && value.equals("Off"))
value = item.DictGetItemTag(1);

return value != null && value.equals("Off") ? null : value;
}
return null;
}
}

item = obj.DictGetItem("AS");
if (item != null)
{
return item.GetName();
}
}
catch (Exception ex)
{
Log.e("RadioError", ex.getMessage());
return null;
}
}
return null;
}

In attach there is a PDF example with mutual checkbox and the code above works.
Can you help me how to implement it in Xamarin?
Attachments:

Please Log in or Create an account to join the conversation.

Checkbox Value 5 years 10 months ago #13922

  • Davide
  • Davide's Avatar
  • Offline
  • User is blocked
  • User is blocked
  • Posts: 814
  • Thank you received: 65
Hi,
you have to expose these methods for Xamarin.
You have to implement it in native Android in the demo project and compile for Xamarin.
I suggest you to check what we do for the other methods in RadaeePDFManager class.

Please Log in or Create an account to join the conversation.

Checkbox Value 5 years 10 months ago #13923

  • nermeen
  • nermeen's Avatar
  • Offline
  • Platinum Member
  • Platinum Member
  • Posts: 962
  • Thank you received: 87

(for ex. Advance_GetRef())

Most probably this method is created by your colleague, to get the reference of annotation you need to call m_annot.Advance_GetRef().


You can also implement the same function in Xamarin as follows:
private String[] m_types = new String[] { "null", "boolean", "int", "real", "string", "name", "array", "dictionary", "reference", "stream" };
private String get_type_name(int type)
        {
            if (type >= 0 && type < m_types.Length) return m_types[type];
            else return "unknown";
        }
public String GetRadaeeRadioValue(Document m_doc)
        {
            Obj obj = m_doc.Advance_GetObj(m_annot.Advance_GetRef());
            if (obj != null)
            {
                try
                {
                    Obj item = obj.DictGetItem("AP");

                    if (item != null)
                    {
                        int type = item.Type;
                        String type_name = get_type_name(type);

                        if ("dictionary".Equals(type_name))
                        {
                            item = item.DictGetItem("D");

                            if (item != null)
                            {
                                String value = item.DictGetItemTag(0);
                                if (value != null && value.Equals("Off"))
                                    value = item.DictGetItemTag(1);

                                return value != null && value.Equals("Off") ? null : value;
                            }
                            return null;
                        }
                    }

                    item = obj.DictGetItem("AS");
                    if (item != null)
                    {
                        return item.Name;
                    }
                }
                catch (Exception ex)
                {
                   
                    return null;
                }
            }
            return null;
        }

Please Log in or Create an account to join the conversation.

Checkbox Value 5 years 10 months ago #13926

  • mfranc28
  • mfranc28's Avatar Topic Author
  • Offline
  • Junior Member
  • Junior Member
  • Posts: 25
  • Thank you received: 0
Thanks, I try it now.

Please Log in or Create an account to join the conversation.

Last edit: by mfranc28.
  • Page:
  • 1
Powered by Kunena Forum