I have used LiveCycle Designer to create a form with an imageField and several text fields. I have a submit button that allows users to send the form data by email. In the email, I receive the embedded image data. How can I take the data in the imageField and use it to create an image file?
Images are binary data, so if the data format is text, you can't very well transfer the data raw. To deal with this issue the data is encoded into a text friendly format. The "transferEncoding" is the encoding technique used to create this textfriendly format. It is amost guarenteed to be "Base64".
So, to save the data as an image file there are two steps.
1. Acquire the image data and Unencode it to binary data. Exactly how this is done depends entirely on your development environment and the libraries you have availible. ".Net", "Java", and "JavaScript" all have built-in Base64 encoders and decoders.
2. Write the decoded data to a file this the extension that matches the MIME type for the data.
That's it.
Thom Parker
The source for PDF Scripting Info
www.pdfscripting.com
Very Important - How to Debug Your Script