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:
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);
}