PDF Forms

I just found the “problem”.

I am using that tax form called “tax_form_1040a.pdf” that comes with the pdf_forms example.

I use this code to test:

var some_field = "abc";

var some_other_field = "efg";

field_values = new Array()
field_values[0] = 'f1-1=abc' //+ some_field;
field_values[1] = 'f1-2=efg' //+ some_other_field;

var pdf_form = pdf_formular // PDF is stored in a blob
var result =  plugins.pdf_output.convertPDFFormToPDFDocument(pdf_form, field_values);

var file = plugins.file.showFileSaveDialog(dateiname);
var success = plugins.file.writeFile(file, result)

This works great! But when I change these two lines to

field_values[0] = 'f1-1=' + 'abc' 
field_values[1] = 'f1-2=' + 'efg'

it doesn’t !?!

Now I finally tried

field_values[0] = ('f1-1=' + 'askdjh').toString()
field_values[1] = ('f1-2=' + 'asdads').toString()

and guess what? That works!

So something seems to go wrong with datatypes here… I am fine now, but I would consider this a bug.

Thanks
Patrick

That’s indeed very weird.
The javascript side seems to be ok.
Maybe something wrong down deeper in java.
Will ask Johan to have look.
Thanks for reporting Patrick.

field_values = new Array()
field_values[0] = 'f1-1=' + 'abc'
field_values[1] = 'f1-2=' + 'efg'
application.output(typeof(field_values[0]))
application.output(typeof(field_values[1]))

RESULT:
string
string

I just thought something was wrong in my mind :?

But since I now jumped over this hurdle, I have one more question: is there currently a way of retrieving the names of the fields in a pdf form? It seems that this functionality is not available with the version of the jpedal.jar that Johan posted somewhere and there is no plugin functionality…

Thanks
Patrick

See the problem (and know what it is) will fix this asap.

fixed for the final of 2.2.1