add text box on pdf

I have a multi page pdf and i need to add a text box on each page can i do this in acrobat or preview ? whats the best way to go about it. I just don’t want to waste my time trying to do it and acrobat only to find out that it can’t be done

thanks for any help

Model: iMac
Browser: Safari 535.11
Operating System: Mac OS X (10.7)

Hi. The editing task can be done manually in Acrobat Pro, but I don’t believe it will be directly scriptable. If you have InDesign, you could script the import of the pages, the addition of the text, and the re-export to PDF.

Since AppleScript seems to be no direct option here, possibly some more information about the task would help.

In a German forum, we recently had a discussion how to get text form fields on pages from a layout program. Finally, we came up with a solution of scripted EPS files that produce text fields when distilled (Adobe or Ghost).

Jürgen

I believe Smile’s PDF drawing tools can easily do this. http://www.satimage.fr/software/en/smile/index.html

You used to be able to use applescript to do it like this:-

tell application "Adobe Acrobat 7.0 Professional"
	activate
	tell active doc
		do script "app.alert ('hello');"
	end tell
end tell

You would insert your Acrobat JS code, which can be found in the Acrobat Javascript Language Guide, in the do script line, something like this:-

set thisCode to "YOUR ACROBAT JAVASCRIPT CODE HERE TO ADD BOX"

tell application "Adobe Acrobat 7.0 Professional"
	activate
	tell active doc
		do script thisCode
	end tell
end tell

However, the above method then developed a problem, apparently it became broken in Acrobat. So, to get round it you have to put your Javascript code in a txt file and then point the do script command at that, something like this:-

set y to (path to desktop) as text

set z to y & "pathToFile:myscript.txt" as alias

tell application "Adobe Acrobat 7.0 Professional"
		try
			do script file z
		on error e
			beep
			return e
		end try
end tell

When creating a new script I’ve often find it easier to sort the Javascript in Acrobat first using the Script Debugger. That can be found under Advanced > Document Processing > Javascript Debugger.
After I’ve sorted the Javascript I then start on the Applescript part.

Javascript also needs enabling in the Acrobat Preferences.

HTH