Signin/Signup with: 
Welcome, Guest
Username: Password: Remember me
Questions about Android development and PDF

TOPIC:

Extracting fields and Checkbox Tick Mark 8 years 4 weeks ago #10432

  • sharikakanakam
  • sharikakanakam's Avatar Topic Author
  • Offline
  • Junior Member
  • Junior Member
  • Posts: 21
  • Thank you received: 0
Hi there,

We have a requirement in our company to show a pdf downloaded from the server to the user of our android app and then allow them to eidt and save the fields. So when the user navigates away from the pdf screen, I would like to loop through all the fields and get the field names and values of those fields to be saved into our app. Now I have created a test app using your pdf sdk and Im able to see the pdf and edit it. So my questions are :

1. I need to detect each field. So that I can turn on each feature like 'ink' for a 'signature' field. How to achieve this?
2. I saw that the checkbox in my pdf gets highlighted when I select it rather than displaying a 'tick'. I would like to show a 'tick' as expected when user selects a checkbox. Now its only getting highlighted. How to achieve this?
3. How to loop through all fields so that I can save the values the user has entered when I navigate away from the pdf?

Also please let me know if I would need a premium version to achieve any of the above?

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

Extracting fields and Checkbox Tick Mark 8 years 4 weeks ago #10434

  • Davide
  • Davide's Avatar
  • Offline
  • User is blocked
  • User is blocked
  • Posts: 814
  • Thank you received: 65
Hi,
1. to detect each field you can loop all the annotations and check the type using the following methods:
m_annot.GetType();
For more info check this: www.radaeepdf.com/documentation/javadocs...ation.html#GetType--

To get annotation field type in acroForm you need this method valid in premium version.
m_annot.GetFieldType()
For more info check this: www.radaeepdf.com/documentation/javadocs....html#GetFieldType--


2. After the tap you need to click the "Do Button" (PDFReader module) or the "Play icon" (RDPDFReader module) to display the tick and perform the annot.
I suggest you to look at PDFPerformAnnot method of PDFReader class to understand how it works.
You probably need :
m_annot.SetCheckValue(boolean check)

To use this method you need a premium license: www.radaeepdf.com/documentation/javadocs...tCheckValue-boolean-


3. To save all the pdf edits you have to call:
m_doc.Save();

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

Extracting fields and Checkbox Tick Mark 8 years 4 weeks ago #10440

  • sharikakanakam
  • sharikakanakam's Avatar Topic Author
  • Offline
  • Junior Member
  • Junior Member
  • Posts: 21
  • Thank you received: 0
Thanks for your help. I was able to detect the fields and get the checkbox working. But I have an issue with the signature field. I have a field in my pdf where user can sign and save. I need to detect this so that I can enable 'ink' programmatically when user is on the signature field. But the 'field.GetType' is not even detecting my 'signature' field. I can see all the text fields coming up while looping through page.GetAnnot(index)., but not the signature one. Can you please help?

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

Extracting fields and Checkbox Tick Mark 8 years 4 weeks ago #10441

  • Davide
  • Davide's Avatar
  • Offline
  • User is blocked
  • User is blocked
  • Posts: 814
  • Thank you received: 65
Hi,
please try with
field.GetFieldType();

According to this www.radaeepdf.com/documentation/javadocs....html#GetFieldType--
If this method returns 4 it is a signature field..

public final int GetFieldType()

get annotation field type in acroForm.
this method valid in premium version
Returns:
type as these values:
0: unknown
1: button field
2: text field
3: choice field
4: signature field

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

Extracting fields and Checkbox Tick Mark 8 years 4 weeks ago #10442

  • sharikakanakam
  • sharikakanakam's Avatar Topic Author
  • Offline
  • Junior Member
  • Junior Member
  • Posts: 21
  • Thank you received: 0
I will make my question more clear. The pdf sdk is not able to detect the signature field in the pdf while looping htorugh the annotations. It can detect all other fields, but not signature. I mean, while looping using :

for(int pageno = 0; pageno < m_doc.GetPageCount(); pageno++) {
for (int index = 0; index < page.GetAnnotCount(); index++) {
Annotation annot = page.GetAnnot(index);
if(("$"+annot.GetFieldName()).equalsIgnoreCase("Signature")){
Log.e("Signature", "Signature field exists");
}


This code never enters the last if loop. That means the sdk is not even recognizing that there is a field on the signature. I hope you understand. Please let me know if you need anything else to help me fix this issue.

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

Extracting fields and Checkbox Tick Mark 8 years 4 weeks ago #10443

  • Davide
  • Davide's Avatar
  • Offline
  • User is blocked
  • User is blocked
  • Posts: 814
  • Thank you received: 65
Hi,
can you please send us your pdf, so we can check it?
Thanks..

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

Powered by Kunena Forum