Working with Imported Data in Acrobat DC

New Here ,
Jul 14, 2020 Jul 14, 2020

Copy link to clipboard

Copied

When data is pushed into pdf forms, is it different than being manually entered?  I have calculation scripts that don't seem to fire based upon field values, and sometimes field formatting is ignored.  Is this imported data somewhere else that I can't reference it with .value?  Or are there only certain things I can do with it after it's imported? 

 

I recently wanted to make the value of 5 fields zero if another field was not blank, but the import just blew the numbers in regardless of calculation order or if I used .value with the target fields or not - it didn't replace the values.  I do have a calculateNow function at the Document level. 

TOPICS
Acrobat SDK and JavaScript, Create PDFs, How to

Views

46

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Most Valuable Participant ,
Jul 14, 2020 Jul 14, 2020

Copy link to clipboard

Copied

Yes, it's different. It doesn't trigger any of the normal events that are triggered when data is entered manually.

You need to move the calculateNow command to execute after importing the data, or to save the file and then re-open it for it to run.

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Jul 17, 2020 Jul 17, 2020

Copy link to clipboard

Copied

Thanks.  After the data is imported, the sytem generates a directory where I get and open the document. I also tried saving it elsewhere and reopening it. Is the field data stored somewhere else where I can't reference it with this.getField("<object>").value?  I tried assigning event.value to it in the field Calc, but it didn't work.  If I change a value in one of the fields manually, the calcs work.  How would I move the CalculateNow command as you mentioned?

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Most Valuable Participant ,
Jul 17, 2020 Jul 17, 2020

Copy link to clipboard

Copied

How are you importing the data, exactly?

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Jul 20, 2020 Jul 20, 2020

Copy link to clipboard

Copied

I don't know, exactly, but the client fills out application data and then presses a button to generate forms.  A zip file is generated with the required forms and when clicked on, gives a directory of required and optional forms, all pdfs.  The application I work on is one of them.  I know XML is involved in the process.

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Jul 20, 2020 Jul 20, 2020

Copy link to clipboard

Copied

LATEST

I did find out I could work with a value within a textbox using it's event.value property, but I haven't figured out yet how to work with other field's values or format input data - I wish I could horizontally center multi-line text.

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines