Expand my Community achievements bar.

Dive into Adobe Summit 2024! Explore curated list of AEM sessions & labs, register, connect with experts, ask questions, engage, and share insights. Don't miss the excitement.

Image Field does not pick up updated/changed images

Avatar

Former Community Member
I have just updated to CS3.



I am trying to achieve what appears to be a very simple task in LiveCycle Designer ES with an available feature, but it is not working.



I am effectively trying to merge images into image fields in a document.



I am creating a form in designer with Image Fields that point to generic filenames (001.jpg, 002.jpg etc).



I want to be able to place a bunch of images in a folder on a PC and have a user simply open the pdf and have the images display in the relevant fields on the form. I don't need or want to worry about linking using XML, OLE or Web Services. The form is simply sitting in a physical folder on a PC together with a bunch of images.



When I create an image field and then click on url to select an image, the location and file is populated in the url field (e.g .\001.jpg) and the current image displays on the form.



When I save this form and then open the PDF up, I see the image in the document. However, if I overwrite this image (001.jpg) in the same folder and open up the PDF, the original image still displays, rather than the newer image (with the same filename), which is what I was hoping to achieve. So the image file names will stay the same, but their contents will change. I am hoping to create a form that will refresh itself with whichever images happen to be in the folder.



As background:



Embed Image Data is unticked. I'm not sure if I need to worry about any binding options but I have set to Normal and Global, but this makes no difference.



I have also tried changing the image path from .\001.jpg to various UNC path formats, but this either comes up with errors on saving the form, or it makes no difference to the end result.



I rang support and they said that the function should work with this version and that I should either read the help file or post a message on the forum. I've read help, so I guess this is my last resort.



I thought this would be a very basic task for Livecycle, but it appears that I have either missed something, or there is some other problem.



Please help.



Thanks

Earl
32 Replies

Avatar

Former Community Member
When you save the PDF the image is made part of the PDF. Each time the form loads it does not go out and reload the image file from the source. I prooved this by setting the image in the same way as you and then removed it from my file system. The image showed up fine in the pdf.

Avatar

Former Community Member
Thanks for your response.



I understand that this is what is happening, but am surprised because this is an image "field". Field to me means that it can be fed by data. This is the behaviour that I would expect to happen with the image control, not the image field control.



Can you suggest how I can achieve the required result?

Avatar

Former Community Member
If you export the data you will see that the image contents are part of the data file so I can argue that the field is working as advertised.



Do you have a server involved that is rendering the form? If not I do not think it can be done with client alone.

Avatar

Former Community Member
No server involved.



It unfortunately appears to be a weak function.



What would be the simplest way to merge images into these fields?



Would I have to go to the effort of building a database of images in say MS Access and perform an OLE link? Can this be easily achieved with XML? I have no XML experience unfortunately.

Avatar

Former Community Member
The easiest way is to have the images returned as base64 encoded images inside of a database call or a web service call. Then you can bind the output from those services directly to the image field and your images will appear.



Hope that helps

Avatar

Former Community Member

Hi Paul,

I am working on the form that is similar to this post and have a problem as well. You have mention: "to have the images returned as base64 encoded images inside of a web service call" Do you have an sample on how to have it done, can you please share. Or can you please explain little bit more on how to start it.

Thanks,

Han Dao

Avatar

Former Community Member

I am assuming that you are using LC Server to construct the Web Service call. I simply retieve the image from the file system or repository (depending on where you stored it) and either of those services creates a document object. Then in a setValue operation you can assign the document object to a string variable that is marked as output. In that assignment you can use the Document functions that are provided and one of them converts the doc to a Base64 encoded string.

Thats all there is to it.

Paul

Avatar

Former Community Member

Hi Paul,

Thanks for the reply. I think I am still confusing here. Do you have an example that you can share? I am still using LC ES with SP3.

Han Dao

Avatar

Former Community Member

I have one but it is for ES2 SP1. I do not think you will be able to import it. I will write out step by step instructions but I cannot get to it until tomorrow.

Paul

Avatar

Former Community Member

Thanks Paul. I appreciate your help on writing the step by step instruction that you will provide. I think it would others as well.

Thanks again,

Han Dao

Avatar

Former Community Member

In the version that you have you only have one choice to interface with LC (SOAP). In ES2 you coudl also use the Rest Interface (start the orchestration with a URL in the image field but that is a topic for another day).

So in using Soap we must Reader extend the form to allow Reader users to make Soap calls or if we are only interested in getting the image when the form renders then we can set the retrieve image soap call to run server side and no Reader Extensions are required. I will assume an interactive form for now.

To build the Soap service we need two things. A service to retrieve the image from whatever location it is in and a setValue service to base64 encode the contents of the image (for transporation on the Soap envelope). So here is what you need to do:

1. Create a new orchestration - it shoudl be shortlived.

2. Add the service that yo need to retrieve the contents of the image - a readDocument (if on the filesystem) or a retrieve content service (if image is in repository).

3. Create a document variable to hold the image.

4. Configure the service to read the image and store it in the new doc var. Note that you may want to create some sort of input parameter to be able to control which image is retrieved by passing in its value.

5. Drag a new SetValue operation on to the orchestration and connect the read operation to the setValue.

6. Create a new variable of type string (unlimited length) and set it as an output. This is what will be returned to the form and will contain the base64 encoded image.

7. In the setValue create a new Mapping.

8. Edit the mapping to have the string variable in the Location.

9. In the Expression side click to Edit the Expression.

10. In the Editor click on the Functions tab and choose the Document Object Functions. A list of Document Object Functions will appear.

11. Double click on the getDocContentBase64(com.adobe.idp.Document)  function. It will be placed in the editor.

12. Renove the com.adobe.idp.Document from inbetween the braces and replace it with the Doc var that holds the image contents. You can click on the Process Data tab and simply choose it from the list. It will be placed in the expression where the cursor currently resides.

13. Now you can save and test you orchestration. Try it from inside of workbench and ensure that it is working as we designed it. You will get a screen of jumbled chars if it works as this is the string that is the base64 encoded image being returned to you.

You may want to turn security off for this service as you do not want to have the user enter credentials each time they get an image.

Now in Designer....

1. Create a new DataConnection of type WSDL

2. Point to the WSDL that was just created.

3. Bind the output string to the ImageField - you may also need to bind any inputs that you have setup.

4. You need a way of executing the SOAP connection - you can use the button provided or you can programmatically execute the service by using:

xfa.connectionSet.DataConnectionName.execute()

You can also put the button provided on the form and prgrammatically click it as well.

Now when you execute the web service the orchestration will run - retrieve the image, base64 encode it and return it to the form. The binding will stream the image contents into the image field and it will display.

Paul

Avatar

Former Community Member

Hi Paul,

Thanks for the valueable instructions. I try to configure the service to read the image based on the input that the user enter but get confused.  Can you please explain a little bit more on how to "Note that you may want to create some sort of input parameter to be able to control which image is retrieved by passing in its value."

Many Thanks.

Han Dao

Avatar

Former Community Member

I woudl start by hardcoding the image name in the service to verify that it works. Once that is done, you need some way of telling the service which image you want. This is usually done by passing in the image name. If all images are an employee number followed by an extension, then you can pass the employee number (the dynamic part of the file name) and construct the rest of the filename (the static part) using a setValue operation and string functions.

Paul

Avatar

Former Community Member

Hi Paul,

I tried as you suggested but got the below error:

"[8/13/10 10:26:24:436 CDT] 00000042 WorkflowDSCIn E com.adobe.idp.workflow.dsc.invoker.WorkflowDSCInvoker logFailedFaultRouting An exception was thrown with name com.adobe.livecycle.fileutils.FileUtilsException message:ALC-FUT-001-011: File "http://msms/images/catalog/200.jpg" does not exist. while invoking service FileUtilsService and operation readDocument and no fault routes were found to be configured."

Can you help on this, please provide your email if you would like to see my process.

Thanks,

Han Dao

Avatar

Former Community Member

If you are using the read from file system then you cannot pass in a URL ...it is expecting a file reference.

paul

Avatar

Former Community Member

Paul,

Well even I tried the UNC path like in Windows explorer, I still got the same error. Please see the error below.

[8/13/10 13:12:58:467 CDT] 00000026 WorkflowDSCIn E com.adobe.idp.workflow.dsc.invoker.WorkflowDSCInvoker logFailedFaultRouting An exception was thrown with name com.adobe.livecycle.fileutils.FileUtilsException message:ALC-FUT-001-011: File D:\My Pictures\Smile.jpg does not exist. while invoking service FileUtilsService and operation readDocument and no fault routes were found to be configured.

Is there a way to make it work with the URL link ?

Thanks,

Han Dao

Avatar

Former Community Member

Stupid question but is the file smile.jpg in that location - on the server where the process is running?

Paul

Avatar

Former Community Member

Well, it was not on the same server. So I moved the file to the server where the LC Process is located then the error is gone.

So here are my two questions:

1) If the file is on a different server, how can I make it work? Does it work with the UNC path like \\ComputerName\SharedFolder\Resource\ ?

2) Is it possbile to make it work with URL link like "http\\abc.com\image\filename.jpg" ?

Thanks,

Han Dao

Avatar

Former Community Member

Then you will need a service to get the file from the other server. If you map a drive to the other server you could use the File Read that you are using. There are other services that come with teh product (FTP, SOAP) that you coudl use to retrieve it.

Paul

Avatar

Former Community Member

Hi Paul,

I was busy with other forms that was more priority and haven't time to continue on this form until now. So far, I have it work fine by hard coding the path for the image in the web service, now I am getting stuck or confuse in making it to use the dynamic value to show the image. e.g. user enter the value like "200" in the form, click on the WS button, it will then concat the UNC path along with image extention .jpg to display on the form like this (\\server name\imageCatalog\smile.jpg) . Can you please advise.

Thanks,

Han Dao