Quantcast
Channel: Aspose.Pdf Product Family
Viewing all articles
Browse latest Browse all 3131

PDF-Android: reading and identifying form fields

$
0
0
I get the form fields using the following code:

String fPath = "whatever...pdf";

com.aspose.pdf.Document pdfDocument = new com.aspose.pdf.Document(fPath);

PageCollection pages = pdfDocument.getPages();

for (int i = 1; i <= pages.size(); i++){

Page page = pages.get_Item(i);

com.aspose.pdf.Form form = document.getForm();

com.aspose.pdf.Field[] fields = form.getFieldsInRect(page.getRect());

if(null != fields){

for(Field fld : fields){   

// get field info here

}

}

}

My questions:

1. How do I know if a field is TextField, or a CheckBox, or a Button, etc?

2. When I read coordinates of a field like: 

double x_ = fld.getRect().getLLX();

double y_ = fld.getRect().getLLY();

it gives me values if the fields were "vertically flipped". E.g. if field A is located near to top (say: x=10, y = 10), the above code would give me coordinates close to the bottom. If the page height was 500 then I would get x_ = 10, y_ = 490. How should I interpret it?



Viewing all articles
Browse latest Browse all 3131

Trending Articles