Skip to main content
Participating Frequently
May 23, 2023
Question

action item to create image field using javascript in adobe acrobat - PDF Forms

  • May 23, 2023
  • 1 reply
  • 4601 views

I am trying to create Action using Javascript to insert Image field at the bottom of page 1 of a document and it has to be duplicated towards end of the document.

Please help me with code. 

I am all new to scripting

This topic has been closed for replies.

1 reply

bhanu3938Author
Participating Frequently
May 23, 2023

i tried using the below for Text field but i am in need of creating Image field

please help 

 

for (var p=0; p<this.numPages; p++) {
	var f = this.addField("Today", "text", p, [222.6179962158203,775.823974609375,372.6180114746094,753.823974609375]);
	f.readonly = true;
}
try67
Community Expert
Community Expert
May 23, 2023

Image fields are actually buttons, so you need to add a button field, not a text field.

Then you need to set it as having an icon (using the buttonPosition property) and finally you can import an image to it using the buttonImportIcon method. Read the documentation of these properties and methods to see exactly how to do that.

bhanu3938Author
Participating Frequently
May 24, 2023

thank you for the guidance. 
i will work on it and getback