How do I import a txt file into a pdf?

I have created a PDF certficate (diploma) where I would like to import student names into. Can I create a txt file and import it into the pdf cerficate? Is this possible. I do not know java script or coding. Is there a simple way to do this. If so please give me step by step instructions. I am new to the acrobat world.

Do I do this through creating an action? I only want the names imported into a text field for name.

I have not created a form, just a pdf document. Help.


Lori Voisin


2 Answers

Voted Best Answer

Step 1. Create a text file named MyNotes.txt
Step 2. Create a PDF file and add a button
Step 3. Attach the text file to the PDF
Step 4. Insert this JavaScript into the Mouse Up event

var v = this.getField("myTextField").value;// Get the contents of the file attachment with the name "MyNotes.txt"var oFile = this.getDataObjectContents("MyNotes.txt");// Convert the returned stream to a stringvar cFile = util.stringFromStream(oFile, "utf-8");// Append new data at the end of the stringcFile += "\r\n" + v;// Convert back to a streamoFile = util.streamFromString( cFile, "utf-8");// Overwrite the old attachmentthis.setDataObjectContents("MyNotes.txt", oFile);// Read the contents of the file attachment to a multiline text fieldvar oFile = this.getDataObjectContents("MyNotes.txt");var cFile = util.stringFromStream(oFile, "utf-8");this.getField("myTextField").value = cFile;
Link to an example


By Eugene Williams   

Do you mean that you want to use a list of names and a PDF file and then create a copy of the file for each name in the list? If so, it's a function called mail-merge, which is available in the plugin of Acrobat X in Word and Excel. But you'll have to create form fields to use it.

-------------------------------------
Visit my custom-made PDF scripts website: http://try67.blogspot.com
Contact me personally: try6767@gmail.com


Gilad D (try67)   


Please specify a reason: