Skip to main content
Participant
October 21, 2020
Question

Place multiple images on pdf document through javascript

  • October 21, 2020
  • 1 reply
  • 673 views

Hello, I am working with a teacher and we are trying to figure out how we can place multiple images on a pdf to make worksheets for the students.  So we have 8 images saved in C:\MathProblems (math1.jpg, math2.jpg, math3.jpg, ect..) and there are 8 different places on the screen we want the images to display in a random order.  The idea is that if we change the images locally that it would change them on the pdf. How would we placed the images in the document using javascript? We are both pretty new to javascripting so any help would be greatly appreciated!

This topic has been closed for replies.

1 reply

try67
Community Expert
Community Expert
October 21, 2020

This is not easy to achieve. In order to import an image into the file automatically you need to use a button ("image") field with an icon, and then use a script to import the image into the button. However, in order to this automatically you need to know the exact path of the image (which seems possible in your case), as well as run the code from a trusted function, which generally requires installing a script file on the local machine of each user who will open this file. Is that possible in your case?

Brian5FB4Author
Participant
October 21, 2020

Since it is only myself and/or the other teacher who will be using the pdf ( we can just save the generated pdf as an image ) we can just install the script on our computers.

try67
Community Expert
Community Expert
October 21, 2020

I also assume you don't want the same problem to appear more than once, right?

This is not a simple scripting task. If you're interested I could write for you the script that will do it and explain how to set it up, for a small fee. You can contact me privately via [try6767 at gmail.com] to discuss it further.