Microsoft Windows Phone 8.1 support ends (13 Jul 2017)

Microsoft has ended support for Windows Phone 8.1

Questions about Android development and PDF

AcroForms filling support

More
10 years 3 months ago #9896 by inibg2
Hello, I have a requirement from a client where I have to fill with some data a PDF which is a Form and then display it into my app. I need this both for android and iOS. So far I managed myself to display a PDF using the library but I couldn't find any info about how to fill a form. Where can I find an example or documentation about this? am I able to do it with the Demo library?

Thank you!
More
10 years 3 months ago #9900 by Davide
Replied by Davide on topic AcroForms filling support
Hi,
yes you can do it with our library.
I suggest you to look at the documentation here: www.radaeepdf.com/documentation/javadocs/
You should look at the following methods:
  • SetEditText
  • SetComboItem
  • SetCheckValue
More
10 years 3 months ago #9909 by inibg2
Replied by inibg2 on topic AcroForms filling support
Great! I'll take a look at that.
by the way, is there any method to flatten the document once I fill it?
Thank you!
More
10 years 3 months ago #9911 by inibg2
Replied by inibg2 on topic AcroForms filling support
I'm having some trouble with this, it seems that methods that are specified to be used with premium or professional license are not working with demo library, it's that correct? I know that I asked that before but I can't figure out why it's not working.

Thank you very much.
More
10 years 3 months ago #9913 by Davide
Replied by Davide on topic AcroForms filling support
Hi,
no, the demo library it's activated with a Premium license to show all the features available with it.

After calling the methods I suggested you, you should re-render page to display modified data.
As written here: www.radaeepdf.com/documentation/javadocs...xt(java.lang.String)
More
10 years 3 months ago #9921 by inibg2
Replied by inibg2 on topic AcroForms filling support
Thanks for you patience.

I used that method you suggested but I'm not rendering the PDF, I'm filling it and saving it again, after it's saved I open it.
In execution time, I get the number of pages the document has, but the number of annotations it's always zero. The document can be filled using Acrobat reader DC without problem.
The code I have is the following:
Code:
private void FillPDF() { Log.d("GXC", "archivo a abrir: " + fileName); // obtengo el documento Global.Init(getActivity()); m_doc = new Document(); Integer ret = m_doc.Open(fileName, filePassword); // Me quedo con el numero de paginas que tiene el documento int i = m_doc.GetPageCount(); Page p; int currentPage; String property, value; Entity entity; Annotation an; // Recorro los diferentes valores Iterator<Entity> it = values.iterator(); while (it.hasNext()) { entity = it.next(); property = (String) entity.getProperty("Campo"); value = (String) entity.getProperty("Valor"); currentPage = 0; an = null; // Recorro las diferentes paginas while (currentPage < i) { Log.d("GXC", "property: " + property); p = m_doc.GetPage(0); p.ObjsStart(); Log.d("GXC", "Arranco " + p.toString()); Log.d("GXC", "cantidad de paginas: " + m_doc.GetPageCount()); Log.d("GXC", "cantidad de anotaciones: " + p.GetAnnotCount()); an = p.GetAnnotByName(property); if (an != null) { Log.d("GXC", "Encuentro y grabo el valor"); an.SetEditText(value); break; } else Log.d("GXC", "no lo encontre al valor"); currentPage++; } } boolean salvo = m_doc.Save(); m_doc.Close(); Log.d("GXC", "se supone que salvo " + salvo); }
Time to create page: 0.427 seconds
Powered by Kunena Forum