3 Replies Latest reply on Jan 29, 2016 8:40 AM by gkaiseril

    Is there a Javascript to update a PDF attachment?

    tracyy42935226

      I have a  form designed in Adobe Acrobat DC that allows the user in Reader to attach a document that is named ApplicantReport.pdf.  The user will need to save the document (which has a button that allows them to do that) and then reset and fill out the next form.  In a separate program, this same user is changing and saving over the file named ApplicantReport.pdf with current info.  As the user resets the form, I need the UPDATED ApplicantReport.pdf to attach to the current form.

       

      Is there a javascript that will update the current attachment?

       

      If not, is there a javascript that will DETACH the current attachment in the reset process so the user can re-attach the current version of ApplicantReport.pdf?

        • 1. Re: Is there a Javascript to update a PDF attachment?
          gkaiseril MVP & Adobe Community Professional

          Can you determine the fie and location that was used add an attachment to a PDF?

           

          Would you always be able to access that file?

           

          I believe both answers are "N0".

           

          Attachments not have a property available to JavaScript that provides the source location for the attached file.

           

          Not all computers are always attached to the Internet and most do not share their full content when attached to the Internet.

          • 2. Re: Is there a Javascript to update a PDF attachment?
            tracyy42935226 Level 1

            Yes, the file location for the attachment will be the same every time and will be on the users own personal hard drive (not on line).  The location of the file is accessible in that location until the file is submitted to me via email.  

            • 3. Re: Is there a Javascript to update a PDF attachment?
              gkaiseril MVP & Adobe Community Professional

              If this form is for a single user, it might be possible. If it is for more than one user, you would have to make sure all users have the file in the very exact location, that eliminates the "My Documents" since the real location for that directory has the user's login name as part of the path and may not always be located on the C drive.

               

              You would also have to be able to identify the attached file attachment by its JavaScript or internal name. This is easy if there is only one annotation.

               

              It is not that hard to just delete the attachment and add a new one.

               

              If any user is using Adobe Reader this becomes more complex since JavaScript in Reader cannot destroy comments with without special rights.