Your achievements

Level 1

0% to

Level 2

Tip /
Sign in

Sign in to Community

to gain points, level up, and earn exciting badges like the new
Bedrock Mission!

Learn more

View all

Sign in to view all badges

Getting image from attachment into image field in a form

Avatar

Level 8
Level 8
Hi all,



I have a process where a customer sends in a PDF with an attached image. This image is then stored in a process variable and I need to put it in another form.



Any ideas how to do this most efficiently?



Sincerely

Kim
2 Replies

Avatar

Level 10
Put the image contents base64 encoded into the data file and merge it onto the template. Bind the image field to the data field that holds the image.

Avatar

Level 8
Level 8
Hi Paul,



I did what you suggested, here goes in more detail:



1. I use processFormSubmission for getting the attacment out of the document (might be possible in another way though).

2. I loop through the list of attachments to get to one I need

3. When I find it I use "getDocContentBase64(doc)" method and saves to string

4. I store the string in my xfaform (in a normal textfield)

5. On the form I have some simple code on initialize that sets the data from the textfield to be assigned to the image field for the image.



Thats it...simple eh 🙂



PS: There is a glitch in the Help for LC 8.2, it says that there is a " getDocFromBase64(aString)" method available, but it is not there...



Sincerely

Kim