Forum Discussion
Storyline 360 - Get element in drop target through JS
Have you considered using the JavaScript library pdf-lib rather than JSPDF?
The reason I say this is because we use it to fill in pdf forms. You can create a pdf template with named fields and then use JavaScript to read the variables from Storyline and drop them into the fields in the pdf. So if your objects were text blocks it would be very simple....
...However, it is also possible to insert a png image into a field and we do use this when creating a downloadable survey form e.g.
The slider button is a small png file which we can insert into the appropriate fields (there are 50 fields in the sample above). using the user's slider responses we use a .setImage(pngimage) command to fill in the corresponding field with the button. I haven't tried it with larger images but I see no reason it wouldn't work.
So you could have 20 fields in your pdf template and then just drop the appropriate image element into the fields in the order your user positioned then in the drag and drop exercise (by testing for an intersection of the image object and your position boxes).
Hope that helps - it would certainly be interesting to try this approach.
Best regards