These forums are now Read Only. If you have an Acrobat question, ask questions and get help from one of our experts.

Is this possible...

Anonymous

Hi all, i was hoping someone could tell me if this is possible!

Is it possible to create a button or somehow modify a distributed file in an Acrobat.com workflow so that when you click the button or the submit button (top-right in the dock) it submits the form to a response file either 1, 2, 3 or 4 times? Depending on the value of a field with in the document. For example, if that field contained the number 2, it would submit it 2 times to the response file?

Any help would be greatly appreciated.

Thank you

My Product Information:
Acrobat Pro 9.1.3, Windows
thomp
Expert
Registered: Feb 15 2006
Posts: 4411
The short answer is no. Submitting the form and collecting data in the response file are two different things. When you "Distribute" a file Acrobat fixes the submission process, i.e., one form submited to one email. When you recieve the emailed form you click on it an it's added one time to the response file.

That said, there are some variations you can force on the process. For example, you could add a second submit button to the form that submits the form multiple times using a script in the manner you've described, but I'm not sure this would have the desired effect, and the user could still press the submit button in toolbar, so its not a good solution. You can also manually add the submitted form to the response file multiple times. This is a better solution but it's still awkward.

What exactly are you trying to achieve? Perhaps there is a better approach to a solution.

Thom Parker
The source for PDF Scripting Info
[url=http://www.pdfScripting.com]pdfscripting.com[/url]

The Acrobat JavaScript Reference, Use it Early and Often
[url=http://www.adobe.com/devnet/acrobat/javascript.php]http://www.adobe.com/devnet/acrobat/javascript.php[/url]

Then most important JavaScript Development tool in Acrobat
[url=http://www.pdfscripting.com/public/34.cfm#JSIntro][b]The Console Window (Video tutorial)[/b][/url]
[url=http://www.acrobatusers.com/tutorials/2006/javascript_console][b]The Console Window(article)[/b][/url]

Thom Parker
The source for PDF Scripting Info
www.pdfscripting.com
Very Important - How to Debug Your Script

smitchell15 (not verified)
Hi Thomp, thanx for the reply. That all sounds very promising.

I'l briefly explain what i am trying to achieve to see what is the best option for me.

This form that i have got is an In-House form ONLY for our staff (Sales department) to use when processing advertisements (So it shouldn't matter about clicking another button instead of the toolbar) Once the sales department fill the form in, it is then submitted via acrobat.com and collected automatically in the response file from the Production department, they then export the data as xml which is linked up to an Excell spreadsheet.

This form contains lots of data and in one field their is a field called "SeriesLength" and inside that field contains a number between 1-4 (which is the number of Weekly Insertions in our publications). For example, if a customer wants to advertise for 2 weeks, it must appear in the spreadsheet as 2 entries so that the Accounts department can do their calculations on it properly. This is where i need something to work so when this form is submiited it appears twice in the response file. This bit i was hoping mite be the easy part as it gets a little more complicated on the second part of my script.

If I can try to get the first part working then i mite move on to phase 2! The second part is for example, i have 2 fields within the same document and in the first field called "Code" there is the words "39.41, 39.42" when that same button is clicked it needs to create the 2 entries in the response file but in one entry the "Code" field needs to contain just 39.41 and in the second entries needs to have 39.42 as its value. The second field is the same sort of thing as the first field i mentioned.

I think the second part could be more tricky...

I have a workaround in place which they just change the fields manually and resubmit it which works great but there is a risk they might not do it right or change something accidently.

Any further help help is appreciated

Thank you
RichLorn
Registered: May 19 2008
Posts: 46
I can't offer a solution to phase one, but for phase two, perhaps it might be more easily handled with string calculations within the excel program?
thomp
Expert
Registered: Feb 15 2006
Posts: 4411
Ok, so for phase 1 you need to place a custom submit button on the PDF that uses JavaScript to submit. The submission URL has to be setup to be the same as the Acrobat.com URL.

If I understand correctly, for phase 2 you'll need some script in the submit code. First, read out the value of "Code" and split it into an array. Then for each submit place a different value from the array back into the "Code" fields. Like this.
var aCodes = this.getField("Code").value.split(","); for(var i=0; i<numSubmits;i++){this.getField("Code").value = aCodes[i];this.submitForm(...);}

Of course you'll also need code to verify that the number of entries in the Code field matches the number of submits.

Thom Parker
The source for PDF Scripting Info
[url=http://www.pdfScripting.com]pdfscripting.com[/url]

The Acrobat JavaScript Reference, Use it Early and Often
[url=http://www.adobe.com/devnet/acrobat/javascript.php]http://www.adobe.com/devnet/acrobat/javascript.php[/url]

Then most important JavaScript Development tool in Acrobat
[url=http://www.pdfscripting.com/public/34.cfm#JSIntro][b]The Console Window (Video tutorial)[/b][/url]
[url=http://www.acrobatusers.com/tutorials/2006/javascript_console][b]The Console Window(article)[/b][/url]

Thom Parker
The source for PDF Scripting Info
www.pdfscripting.com
Very Important - How to Debug Your Script

smitchell15 (not verified)
Hi Thomp,

Thank you very much for the good reply, i'l have a play and work with the info you gave me and i'l see how i get on. Cheers

And cheers RichLorn too, was going to investigate that route too till Thomp replied :-)