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

exporting pictures from LCycle form

Registered: Mar 14 2011
Posts: 2

How to resolve next problem:
I made form for one of my clients in which their clients linked txt & images. Now when thay answered, with linked txt & images back I dont knew if it is posible/or how to export images out. From document size (MB) it's clear that pdf form have original images packed in, not only link to them. Tnx.

My Product Information:
LiveCycle Designer, Windows
radzmar
Expert
Registered: Nov 3 2008
Posts: 1202
Hi,

I have a solution for this, but it has it's limits.

1. It only works in Acrobat, as it's uses the "createDataObject" method to save an image as attachment, which then can be saved to the hard drive

2. For a reason I can't figure out, it only works for image sizes under 50Kb. LArger images always are cut off.

Try this Code in a button's click:Event.

  1. //Get Base64 data of the image field
  2. var b64Data = ImageField1.value.image.value;
  3. //Convert to a read stream
  4. var ReadStream = util.streamFromString(b64Data);
  5. //Decode from Base64
  6. var DecodedStream = Net.streamDecode(ReadStream, "base64");
  7. //Attach an empty image file
  8. event.target.createDataObject("MyExportImage.png", "", "image/png");
  9. //Update attached image file with stream data
  10. event.target.setDataObjectContents("MyExportImage.png", DecodedStream);
  11.  
  12. //Show attachment pane
  13. event.target.viewState = {overViewMode:7};

radzmar
LoveCycle Blog
Documents you need:
LiveCycle Designer ES2 Docs

Registered: Mar 14 2011
Posts: 2
tnx for answer but I need to extract images with their original size. I can't belive that extraction/export isn't possible!!!