mirta mirta - 1 year ago 123
Javascript Question

Insert an image into pdf (Adobe Acrobat Pro) using javascript

This is what I want to do:


I know this code is not correct, but is there a way to do this? I couldn't find the solution in Acrobat's documentation.

I need to do it using javascript because
is a variable I'm pulling from a database...

Answer Source

I got an anwser on Adobe forums. Here is the full discussion: https://forums.adobe.com/message/8694023#8694023

var f = this.getField("btnImage");
  if (f.buttonImportIcon("/C/image.pdf") == 0){  // if 0 == no error

Also when you are setting a button you have to select an option "Icon only" for this to work.