Image Field does not pick up updated/changed images

Avatar

14-08-2008

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

Replies

Highlighted

Avatar

Avatar

Han_Dao

Avatar

Han_Dao

Han_Dao

11-08-2010

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

Highlighted

Avatar

Avatar

pguerett

Total Posts

7.7K

Likes

611

Correct Answer

692

Avatar

pguerett

Total Posts

7.7K

Likes

611

Correct Answer

692
pguerett

12-08-2010

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

Highlighted

Avatar

Avatar

Han_Dao

Avatar

Han_Dao

Han_Dao

13-08-2010

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

Highlighted

Avatar

Avatar

pguerett

Total Posts

7.7K

Likes

611

Correct Answer

692

Avatar

pguerett

Total Posts

7.7K

Likes

611

Correct Answer

692
pguerett

13-08-2010

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

Highlighted

Avatar

Avatar

Han_Dao

Avatar

Han_Dao

Han_Dao

13-08-2010

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

Highlighted

Avatar

Avatar

pguerett

Total Posts

7.7K

Likes

611

Correct Answer

692

Avatar

pguerett

Total Posts

7.7K

Likes

611

Correct Answer

692
pguerett

13-08-2010

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

paul

Highlighted

Avatar

Avatar

Han_Dao

Avatar

Han_Dao

Han_Dao

13-08-2010

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

Highlighted

Avatar

Avatar

pguerett

Total Posts

7.7K

Likes

611

Correct Answer

692

Avatar

pguerett

Total Posts

7.7K

Likes

611

Correct Answer

692
pguerett

13-08-2010

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

Paul

Highlighted

Avatar

Avatar

Han_Dao

Avatar

Han_Dao

Han_Dao

13-08-2010

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

Highlighted

Avatar

Avatar

pguerett

Total Posts

7.7K

Likes

611

Correct Answer

692

Avatar

pguerett

Total Posts

7.7K

Likes

611

Correct Answer

692
pguerett

13-08-2010

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