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

Folder Level Javascripts on Server??

Sameer_Chebbi
Registered: Jul 10 2011
Posts: 9

I need help for this following situation -
 
1. User logs in, accesses a PDF form from the server, fills it.
2. On clicking the custom save button, the javascript that runs should save the PDF file onto a location on the server. This location is mentioned in the saveAs method in the javascript.
 
The problem here is - where do i install the folder level javascript?? While trying it out locally on my machine, i installed the folder level script into the Javascripts folder present in the appplication's directory.
 
Can the same be done on the server??
 
Could you please explain it stepwise? I'm quite new to scripting on Acrobat.
Eagerly awaiting for your response

Sameer Chebbi

My Product Information:
Acrobat Pro 10.0, Windows
try67
Expert
Registered: Oct 30 2008
Posts: 2398
You're not allowed to use Acrobat as a server product. It's against the EULA.

- AcrobatUsers Community Expert - Contact me personally at try6767 [at] gmail [dot] com
Check out my custom-made scripts website: http://try67.blogspot.com

Sameer_Chebbi
Registered: Jul 10 2011
Posts: 9
Hi Try67,
I don't intend to do so. I just need the user(s) to be able to access a PDF form, fill it and save it back on to the server. Any other way out?

Sameer Chebbi

try67
Expert
Registered: Oct 30 2008
Posts: 2398
The trusted saveAs script must be saved on the user's local machine. It can't be accessed via the server.

- AcrobatUsers Community Expert - Contact me personally at try6767 [at] gmail [dot] com
Check out my custom-made scripts website: http://try67.blogspot.com

Sameer_Chebbi
Registered: Jul 10 2011
Posts: 9
Thanks try67. There's also export as "PDF The Complete Document" option to use while performing the "Submit the form" action using the button. But in this case can you tell me what should be the URL like??
Should it point to a php script file?? Could you tell me the functions i can use in the php script file?

Regards..

Sameer Chebbi

try67
Expert
Registered: Oct 30 2008
Posts: 2398
Sorry, I'm not proficient enough in PHP to help you with that.

- AcrobatUsers Community Expert - Contact me personally at try6767 [at] gmail [dot] com
Check out my custom-made scripts website: http://try67.blogspot.com

George_Johnson
Expert
Registered: Jul 6 2008
Posts: 1876
Yes, the URL needs to point to a PHP script. The script would take the contents of the incoming POST and save it to a file on the server. Exactly how you do this is PHP-dependent, but it's fairly simple. One of the HTTP headers will give the content length in bytes, so all you have to do is read that many bytes into a buffer and save the buffer to a file, using some sort of naming convention to avoid overwriting existing files.