Skip to main content
Participating Frequently
June 25, 2020
Question

Acrobat Form fillable PDF Javascript - How can we write to text file

  • June 25, 2020
  • 1 reply
  • 1942 views

Can somebody help me to write text into the txt file at some fixed location.
Example  var text = How are you

and want to write this text into the abc.txt file and save this on C:\temp\

This topic has been closed for replies.

1 reply

try67
Community Expert
Community Expert
June 25, 2020

There's no simple way of doing that. You can create an attachment and then export it, but the user will have to select where it is saved.

Participating Frequently
June 26, 2020

Thank you for your quick reply, How do I create a custom attachment with specific data (Like I just want the text How are you in that attachment). and I'm using Adobe Acrobat DC
Is this something you are saying...

var testData = "Testing";
this.createDataObject({cName: "test.txt", cValue:testData });
this.exportDataObject({cName: "test.txt", nLaunch:0});

If yes, It's working for me on my local machine, but not working on a server. 

 

try67
Community Expert
Community Expert
June 26, 2020

You're not allowed to use Acrobat on a server anyway...