These forums are now Read Only. If you have an Acrobat question, ask questions and get help from one of our experts.

Forms, Tracker, Export, Images

Jun
Registered: Mar 22 2011
Posts: 10

Hello,
 
I have created a form with an image field, which allows a form filler to select an image file, which becomes embedded as a part of response.
 
When I export the responses and open in Excel, I cannot see the images, but I see a long chain of text information.
 
I do not know what to do with the long chain of text information, which is probably the image files exported in a computer language.
 
Is there a way to export viewable images to the export file?
 
If not, is there a way to keep track of the image contents in a easier way, like showing the filename ?

My Product Information:
Acrobat Pro 10.0.2, Windows
radzmar
Expert
Registered: Nov 3 2008
Posts: 1202
Hi,

assumed you created your form with Designer, you then can store the embedded images into attachments, which you can easily save to the hard drive.

This button script will take the image data of an image field "ImageField1" and save it as attachment:
  1. var N = "0";
  2. if (event.target.dataObjects !== null)
  3. {
  4. N = event.target.dataObjects.length.toString();
  5. }
  6.  
  7. //Get Base64 data of the image field
  8. var b64Data = ImageField1.value.image.value;
  9. //Convert to a read stream
  10. var ReadStream = util.streamFromString(b64Data);
  11. //Decode from Base64
  12. var DecodedStream = Net.streamDecode(ReadStream, "base64");
  13.  
  14. var NewAttachmentName = "MyExportImage" + N + ".png";
  15. //Attach an empty image file
  16. event.target.createDataObject(NewAttachmentName, "", "image/png");
  17. //Update attached image file with stream data
  18. event.target.setDataObjectContents(NewAttachmentName, DecodedStream);
  19.  
  20. //Show attachment pane
  21. event.target.viewState = {overViewMode:7};

radzmar
LoveCycle Blog
Documents you need:
LiveCycle Designer ES2 Docs

Jun
Registered: Mar 22 2011
Posts: 10
Is is possible to select an image file while filling out a form in Acrobat Reader, for example, then let the form extract the file name of the selected image file and display the file name in a text field? If this can be done, it will save me the trouble of actually importing or embedding the image file into the submitted form. All I need to show in the resulting spreadsheet is the file name, and not the image itself.. Thank you, very kindly for your advise.
radzmar
Expert
Registered: Nov 3 2008
Posts: 1202
Hi,

you can determine the path to the image.
You possible can use the layoutReady:event of a textfield to check the image field.

If the image field allows embedding of the image the script looks like:
  1. Form1.#subform[0].Textfield1::ready:layout - (JavaScript, client)
  2. this.rawValue = ImageField1.desc.nodes.item(0).value;
If the images are only referenced to the image field, use:
  1. Form1.#subform[0].Textfield1::ready:layout - (JavaScript, client)
  2. this.rawValue = ImageField1.value.nodes.item(0).value;

radzmar
LoveCycle Blog
Documents you need:
LiveCycle Designer ES2 Docs