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
BedrockMission!

Learn More

View all

Sign in to view all badges

Getting image from attachment into image field in a form

Avatar

Avatar
Validate 1
Level 7
kc
Level 7

Likes

0 likes

Total Posts

402 posts

Correct Reply

0 solutions
Top badges earned
Validate 1
View profile

Avatar
Validate 1
Level 7
kc
Level 7

Likes

0 likes

Total Posts

402 posts

Correct Reply

0 solutions
Top badges earned
Validate 1
View profile
kc
Level 7

16-10-2008

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

Replies

Avatar

Avatar
Boost 500
Level 10
pguerett
Level 10

Likes

611 likes

Total Posts

7,689 posts

Correct Reply

692 solutions
Top badges earned
Boost 500
Boost 50
Boost 5
Boost 3
Boost 250
View profile

Avatar
Boost 500
Level 10
pguerett
Level 10

Likes

611 likes

Total Posts

7,689 posts

Correct Reply

692 solutions
Top badges earned
Boost 500
Boost 50
Boost 5
Boost 3
Boost 250
View profile
pguerett
Level 10

16-10-2008

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

Avatar
Validate 1
Level 7
kc
Level 7

Likes

0 likes

Total Posts

402 posts

Correct Reply

0 solutions
Top badges earned
Validate 1
View profile

Avatar
Validate 1
Level 7
kc
Level 7

Likes

0 likes

Total Posts

402 posts

Correct Reply

0 solutions
Top badges earned
Validate 1
View profile
kc
Level 7

17-10-2008

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