9 Replies Latest reply on May 25, 2011 1:22 PM by sparrowce

    Display Image from Attachment?

    sparrowce

      Using the sample file (AttachmentTest2_version8_launch_attachment_new.pdf) found here, http://209.46.39.53/thread/341433?decorator=print&displayFullThread=true, I'm using this for a form that also has an image field where the user clicks to add image to the form, and it works nicely, but would like to merge/combine it with the functionality of the image field where a user selects a pic and it displays on the form.  The image field did not give the option to be able to retrieve the pic when it was submitted, so I'm hoping to find a solution that once the user adds an image using the image field, that file could be automatically added to the attachment listing per the sample file.  In other words, in the sample, the user clicks 'add file' to select/add to list of files attached.  Is it possibe to capture the file and add as attachment from the image field, and then still be able to add additional attachments if needed.  The idea is to be able to display the image of whatever pic they have.  If there is a better way to accomplish, that would be great, and hope I've explained ok.  Thank you.

        • 1. Re: Display Image from Attachment?
          sparrowce Level 1

          One additional piece of info - in the sample file, and the form where I used sample, the 'add file' does not work once it has been distributed.  Before it's distributed, it works fine, but once it's distributed, with reader extended, that button no longer works - clicking doesn't do anything.  The other buttons do activate, but they are dependant on having a file in the list.  Thank you for any help on that, too.

          • 2. Re: Display Image from Attachment?
            pguerett Level 6

            The image field will take the image contents, base64 encode them, and put them into the data dom so that when you submit data the

            image contents are there. It does not exist as something you can attach as a file attachment.

             

            The distribute functionality will add code to override any submit buttons ......this could be what is happening to you.

             

            Paul

            1 person found this helpful
            • 3. Re: Display Image from Attachment?
              sparrowce Level 1

              Thank you, the 'add file' code that was in the sample (I believe it was your sample and it has been extremely helpful, thank you for posting it) for the button that is not working once distributed is pasted below - is this what is getting overridden in the distribution process, and if so, is there any way to modify to prevent that from happening?

               

              For the other issue of trying to find a way to auto add the image to the list of files is ok if not possible, we will just need to decide whether to distribute the form without the image showing and just collect in the list, or whether to have them insert the image and add to list.

               

              However, the 'add file' button not working once distributed will be a problem, and appreciate any help, thank you.

               

              Untitled.#subform[0].Button1::click - (JavaScript, client)

              var myDoc = event.target;

              var sFile = "myFile" + NumericField1.rawValue;

              myDoc.importDataObject({cName: sFile});

              var myDataObject = myDoc.getDataObject(sFile);

              var sFileName = myDataObject.path;

              ListBox1.addItem(sFileName,sFile);

              NumericField1.rawValue = NumericField1.rawValue + 1;

               

              • 4. Re: Display Image from Attachment?
                pguerett Level 6

                Once it is distributed are the users using Reader or Acrobat? I assume that you are using Acrobat and then distributing it....right?

                 

                Paul

                1 person found this helpful
                • 5. Re: Display Image from Attachment?
                  sparrowce Level 1

                  I do not know all the variations that will be used.  The predominant should be Reader and Adobe Pro, but sometimes we get other forms returned that have been completed with NitroPDF, XChange PDFViewer, Mac Preview and other variations, but these are rare and exceptions and usually come back with invisible text we have to do some workarounds to capture.  Most will have some version of the Reader or some have Adobe Pro.

                  • 6. Re: Display Image from Attachment?
                    pguerett Level 6

                    Then that is your issue ....Reader does not allow you to add attachments by default. You must Reader Extend the file using LiveCycle Reader Extensions server to allow file attachments. if they are using Acrobat this is not an issue.

                     

                    Paul

                    • 7. Re: Display Image from Attachment?
                      sparrowce Level 1

                      I can see how that could be a problem, and may not be understanding rightly, but unfortunately, I haven't gotten that far as I am only testing on my own machine and do not have Reader installed, only Adobe Pro 9.3.2, and I'm extending the form for Reader when I distribute/test.  All the other buttons and drop-downs, etc., work except the add files button, and am not sure what is wrong with the way I've done the form, as it does work correctly if I don't distribute.  Thank you again.

                      • 8. Re: Display Image from Attachment?
                        pguerett Level 6

                        Extending with Acrobat does not give you that functionality ...thats why I said you need LiveCycle Reader Extensions server to accomplish this.

                         

                        Paul

                        • 9. Re: Display Image from Attachment?
                          sparrowce Level 1

                          Thank you, I did not have a good understanding, sorry.  Don't have LiveCycle Reader Extensions server so I believe we will need to look for another solution then, unfortunately.  Thank you for your help.