First of All, I'm not Java Developer:( I just need small programm, that will output to me coordinates of field by field name from existing pdf file, that I will type when I call my class from command line, something like this:
javac GetField.java
java GetField <myForm.pdf>, <myFieldName>
I'm using itext on my server. Now I'm trying to run simple code:
import com.itextpdf.text.*;
import com.itextpdf.text.pdf.*;
import java.io.*;
import java.util.*;
import java.awt.List;
class HelloWorld{
public static void main(String[] args) throws IOException {
PdfReader reader = new PdfReader("Noname.pdf");
AcroFields fields = reader.getAcroFields();
float[] positions = fields.getFieldPositions("Signature");
System.out.println( positions );
}
}
But I have error: "Type mismatch: cannot convert from List to float[]". When I replace
float[] positions = fields.getFieldPositions("Signature");
System.out.println( positions );
with
System.out.println( fields.getFieldPositions("Signature") );
I got result "[com.itextpdf.text.pdf.AcroFields$FieldPosition@36af35b1]", but I need float values. Can you help me please with this task?