JavaScript to embed the file as an attachment

I found a Javascript script on the forum that allows me to have a user of the form to join a file a PDF form in Adobe Reader.  The script is below and works very well... until I consult the document saved on a computer.  I discovered that Adobe Reader Mobile doesn't recognize attachments added as annotations (only the embedded files).  Can someone help me to modify this script so that the file is truly integrated and not added as an annotation?  My follow-up question is the javascript to detach the file with a button.  I use Adobe Acrobat DC to set the shape.  Thank you very much for your help!

The way in which it is programmed, it's that the button itself with an action of mouse upward, the following Javascript code is executed:

If (app.viewerVersion < 11) {}

import_pre_11();

} else {}

import_11();

}

Then, there's a document level javascript to attach the file that is scheduled as follows:

Initialize the attachment number

attachment_num = 1;

Original location of file attachment icon

The value of x is incremented below

FOPI var = {x_init:-72, 72 - x:, y: - 72};  In the lower left corner of the page

function import_pre_11() {}

If (app.viewerType = 'Reader') {}

App.Alert ({}

CMSG: "you must user Reader version 11 or later to attach files to this form."

CTitre: "attach file error"

nIcon: 3,.

nType: 0

});

return;

}

Invite the user to import a file

App.Alert ({}

CMSG: "click the OK button to select a file on your system.',

CTitre: "attach a file",

nIcon: 3,.

nType: 0

});

try {}

var rc = this.importDataObject ("Attachment" + attachment_num);

If {(rc)

attachment_num += 1;

App.Alert ({}

CMSG: "attachment successful.\r\rOpen Panel attachments to access attached files.",

CTitre: "attachment Successful."

nIcon: 3,.

nType: 0

});

} else {}

App.Alert ({}

CMSG: "attachment canceled.",

CTitre: 'attachment cancelled. "

nIcon: 3,.

nType: 0

});

}

} catch (e) {}

App.Alert ({}

CMSG: 'could not attach file.',

CTitre: 'could not attach the file.

nIcon: 3,.

nType: 0

});

}

}

function import_11() {}

try {}

var annot = addAnnot({)

page: event.target.page;

type: "FileAttachment,"

Author: the form "user."

name: "attachment".

point: [oFAP.x, oFAP.y].

content: "the folder entry on:" + util.printd ("yyyy/mm/dd hh: mm:", Date()) new, "."

attachIcon: "Trombone".

});

annot.cAttachmentPath; Prompt the user to select a file to attach

oFAP.x += 18;  Increment the x for the icon location

} catch (e) {}

App.Alert ({}

CMSG: "could not reach file.\r\rPlease report this error."

CTitre: 'file attachment error. "

nIcon: 3,.

nType: 0

});

}

}

I know, I wrote it. Player cannot add the embedded files, even manually, unless the file player compatible with the use of the right embedded file attachment.

Tags: Acrobat

Similar Questions

  • How to disable the feature "send the file as an attachment?

    11.0.13 worm

    How to disable the feature "send the file as an attachment?

    /************************* Hide Menu ********************************/

    Hide the default file > Send file... menu

    app.hideMenuItem ("Email");

  • Send the file as an attachment to email does not

    any help would be greatly appreciated...

    When I click "send the file as an attachment" it will open outlook with the file PDF attached, but when I click on send e-mail, the e-mail closes as it is sent but never gets actually sent (Nothing in sent items and the recipient never gets the e-mail)

    Adobe Acrobat Pro 11 (Creative Suite installed cloud)

    Outlook 2013

    Thanks for the reply.  I thought about it.  The user has 2 versions of Office installed and that was causing the problem.  Everything is good now.

    Thank you

    Sandy

  • Delete the file as an attachment button does not work

    I have a form with a box the user can attach files. There are three buttons. To add a file to open the file to see it and the third button to delete the file that is highlighted in the drop-down list. Remove the button does not work. You see something wrong with my script?

    ADD A SCRIPT FILE

    MeetingMinutes.LogoControls.Attachments.Button1::click - (JavaScript, client)
    myDoc = event.target var;
    sFile var = "myFile" + NumericField1.rawValue;
    myDoc.importDataObject ({cName: sFile});
    myDataObject var = myDoc.getDataObject (sFile);

    sFileName var = myDataObject.path;

    ListBox1.addItem (sFileName, sFile);

    NumericField1.rawValue = NumericField1.rawValue + 1;

    OPEN THE SCRIPT FILE

    MeetingMinutes.LogoControls.Attachments.Button2::click - (JavaScript, client)
    try {}
    myDoc = event.target var;
    var sFile = ListBox1.rawValue;

    myDoc.exportDataObject ({cName: sFile, nLaunch: 2});
    }
    catch (e)
    {
    App.Alert ("Click on the file you want to open (select)," + "\n" + 'then click on the button to open the selected file' ");
    }

    REMOVE THE BUTTON SCRIPT

    MeetingMinutes.LogoControls.Attachments.Button3::click - (JavaScript, client)
    try {}
    myDoc = event.target var;
    var sFile = ListBox1.getDisplayItem (ListBox1.selectedIndex);

    If (sFile! == "") {}
    var nResponse = xfa.host.messageBox ("you are about to delete the attached highlighted file. \n\nDo you want to continue? ', 'delete an attachment ", 1, 2);
    If (nResponse == 4) {}
    myDoc.removeDataObject (sFile) + ListBox1.deleteItem (ListBox1.selectedIndex) + (NumericField1.rawValue = NumericField1.rawValue - 1);
    }
    } else {}
    xfa.host.messageBox ("no document selected. Click on the file to delete. ») ;
    }
    } catch (e) {}
    xfa.host.messageBox ("error in deleting of document");
    }

    Change var sFile = ListBox1.getDisplayItem (ListBox1.selectedIndex);

    TO

    var sFile = ListBox1.rawValue;

    Kyle

  • Send the file as an attachment in Mail shortcut keyboard

    Hello

    I want to create a keyboard shortcut for the file selected in the Finder as an attachment in E-mail. So when I press the keyboard shortcut, a new message new message appears with the selected attached file.

    This was possible in previous versions of Mac Mail (Yosemite and earlier), but I do not see in El Capitan.

    Please comment

    Rgds

    ~ n ~

    Please open finder and select the file to attach (use keyboard shortcut command + A), copy it (control + C)

    Open mail app, click Command-N a new composition window.

    Finally, click the command + V is pasted the file.

    Thank you!

  • How can I attach a picture file to an e-mail. Whenever I click, the action opens just the file instead of attaching it to the email.

    I try to attach a file of pictures to send to friends by e-mail.  Can someone help me please?

    First of all, make sure that the entire file does not exceed the limit set by your mail server. Check first with them over the limit.

    Suugestion only:
    Could a right click on the file > Send to > compressed (zipped) folder.
    Now, attach the file zipped e-mail.
    P.S. I think that you should always check with the size of the zipped folder.

  • Why the file name of the file as an attachment with Annotations "attach a file" (trombone) become unknown when the observations are published?

    Our company recently purchased Adobe Acrobat Pro XI intended to be used for shared electronic reviews.  We use the send for shared review in Adobe Acrobat Pro XI, and all the comment tools work as expectedexcept the trombone in Annotations.

    When a Word or Excel or Image (png, jpeg) file is attached using the trombone of Annotations, the initiator may initially see and open. But once feedback is enabled and the review file is closed, the file 'Name' becomes 'Unknown' (even if the Description is the correct file name and extension).  Change information are unknown, such as size and compressed size.

    When the control file is then reopened, even the initiator cannot open the file, although:

    • The location of the file is marked with the paper clip in the document.
    • The file name is displayed in the list of comments with the name of the initiator.
    • In the list of attachments (the paper clip under the thumbnails and bookmarks), the name appears as unknown, shows the file name Description, update is unknown, the size is unknown and compressed size is unknown.


    The file name cannot be published, although the Description file can be.

    We have followed the procedure described in the tutorials but may not know how to resolve this situation.  As this feature was the reason for the purchase of Adobe Acrobat Pro IX, we would any help. Please leave out the basics because we are new users.

    We have several people with Adobe Acrobat Pro XI and the rest have Adobe Reader XI is a Windows platform.  Can someone please give us some advice how to get this function runs as described?

    The bug is fixed in the latest Adobe Acrobat Pro XI 11.0.09 update (update: in Acrobat Pro, go to help-> Check for Updates...).

    -Rohit Sharma

  • How can I activate the files zipped to attach to all my emails

    When I have someone e-mail with a picture or document or whatever it IS, when they click on the attachment, it says below, "Zipped File" and when you click on it, it can show anyone what I have in my personal files, documents, and all my photos.  How I stopped the zipped files to be there?

    Sounds to me that you have an installed zip tool that integrates with your e-mail without a name client.  Uninstall the zip tool.

  • How to open the file as an attachment with extenstion .xlsx received in an e-mail?

    I've never used WordPad; now an email come through and opens to a page of hieroglyphs. How can I make readable? Please and thank you.

    See you soon,.

    Jififner

    Hello

    This is an Excel file

    you don't say what version of office you have

    you have the latest office compatibility pack?

    http://www.Microsoft.com/downloads/en/details.aspx?FamilyID=941b3470-3ae9-4aee-8f43-c6bb74cd1466&DisplayLang=en

  • I need to combine several PDF files into a single attachment on my iPhone. I subscribe to the $ 9 per month package, but I can't seem to find an option to combine the files of one attachment. Can you please help?

    I need to combine PDF files in a magnetic. I subscribe to the $ 9 per month package. Is this possible?

    Hello

    With Adobe Acrobat iOS app, we can only create PDF of it. To combine the documents, go to https://cloud.acrobat.com/combinepdf on your device browser.

    Thank you

    Abhishek

  • Help the action of the button to open a file that is attached to the main pdf doc

    Hello

    I created a button and used an icon saying "click here...". "the action I want to join him, is having on the mouse down to open the file that is attached to the document.

    Is this possible?  If so, how direct the acton "open a file" to be laid down in the document?  path can not understand...

    He had an idea of how to make a javascript button action to open the fixing Panel...

    That's what was written... and then below that is my question about what was written...

    Thomp wrote:
    Try thisif (app.viewerVersion < 8)
    app.execMenuItem (...);
    on the other
    app.execMenuItem (...);
    What would go in the "(...)" above?

    I am very poor in javascript, but I'm guessing that there is something that I need to fill? Am I wrong?
    Thank you...
    I, too, am trying to get my button action to open the attached document in my form pdf - NOT the navigation panel... I've already done this...
    Thanks again for all your comments!

    Hi sicilianmissy65,

    Try this.  Attach the file you want to open in your main PDF.  Now, to add a button and in the dialog box properties on the Actions tab, select go to a Page view and click the Add button.  A small dialog box will appear to the top heading create go to View - don't do anything with it yet.  Now, double-click the attached PDF file to open it.  Now click the set link in this dialog box.  In the main dialog box, you should now see in the action area-

    Navigate to a Page in another document

    Attachment file:PDF

    Hope this helps,

    Dimitri

    www.pdfscripting.com

    www.windjack.com

  • How to attach the file to send by mail

    I'm trying to understand how to attach a file and send it to the email from my address book

    Hi marilynp47029385,

    Please see this KB doc for the procedure to send the file as an attachment by application: sharing PDF files

    You can also directly reach email account file. Compose an email and click on the attachment icon. Then, browse to the location of the file and select the file. It will focus on your mail.

    Let us know if you encounter any problem.

    Kind regards

    Meenakshi

  • Can the files be loaded on Micro-SD Audio cards and then played on Sansa c250 player?

    I understand I can load audio files on a Micro-SD card, then insert this card into my Sansa c250 and play the files (without ever attaching the drive to computer cord)?   If true, this seems a better and faster approach for me.

    Yes you can do it.

  • Creating a csv file, then send file contains an attachment...

    I have a question to multiple segment...

    I need to create a csv file and then attach this file to an e-mail. I have a general idea on how to get it going, but before I start coding I have a few questions...

    These are the classes / pseudo-code...

    1. Create file, replace an existing one because just one instance of this file...

      QString csvFile = QDir::homePath() "/ mycsvFileAttachement.csv";
      QFile newFile (csvFile);

    2. Data through the loop model and write each record in the file

      Not sure how to do this part with C++. Any sample to show how to achieve?

    3. Create a new email and attach the newly created file... So, for this piece I was looking @ the MessageBuilder class...

      https://developer.BlackBerry.com/Cascades/reference/bb__pim__message__messagebuilder.html

      It would have been so much simpler to have the possibility to use the invoke framework to push a new message, user interface, but from what I've read, it is basically impossible to hang an attachment via the invoke framework. Is this correct?

    4. Display the user interface for new Message and wait until the message is pulled off by user

      https://github.com/BlackBerry/Cascades-samples/tree/master/messages

      To send an email, the example message gives me all the code necessary to accomplish this feature. But I also want to provide a contact selector the user, any sample that shows how to do this?

    If the file save location is important you want to prompt the user in the dialog box a file selector.  They can save documents or the SD card, etc.  If not, then create a temporary file, i.e. do not use QDir::homePath();

    filePicker = new FilePicker();
    filePicker-> setType(FileType:: other);

    connect to this kind can at least make a deleteLater()

    Connect (filePicker, signal (Canceled (()), this, slot (filePickerCanceledSlot ()));

    sign in here to get the name of the file to save on
    Connect (filePicker, SIGNAL (fileSelected(const QStringList &)),
    This, SLOT (filePickerSelectedSlot (const QStringList)));

    What about writing in the file, the QTextStream use for you help.  Do something like this:

    QFile file (fileName);
    bstatus = file.open (QIODevice::WriteOnly);
    If (! bstatus) {}
    qWarning()< "failed="" to="" open="" file="" "=""><>
    return;
    }

    QTextStream out (&file);)

    QListIterator iter (myObjets);

    {whilte (ITER.hastNext ()}

    MO = iter.next ();

    the < mo-=""> field1 < ","=""> < mo-=""> Field2< ","="" ....=""><>

    }

    file-> close();

    I don't know how to send it as an attachment. You can search for it on this forum because it's a frequently asked question.  Myself I could never get send attachment to work the way I wanted so abandoned.  And decided the user can only send the file as an attachment if they want to.

    I hope it is of some value.

  • Cannot modify an imported placed the file have

    Hello

    I placed a native AI file into another document of the I and I can't edit the imported file.  It has a bounding box that I can adjust the size, but it won't let me change the color.  Also described logo isn't real text, does this means that I can't change it later?

    I have also included a second screenshot of an error message I get when I import / place one single AI file to another.

    Any help would be really appreciated.

    illustrator.jpg

    error_message.png

    What you place is not the file, but its private PDF data fork. In case you need to make some changes, maybe copy and paste a better way.

    That said: embed the file and then you can change which slept editable.

    The error tells you that color management is configured differently now. Currently, keep you the CMYK numbers. When the file has been implemented you converted in the profile.

Maybe you are looking for

  • No internet connection

    I can connect with my mininotebook net home wi - fi connection, but it won't let me connect to internet - yesterday it was OK and I could connect to the internet via wi - fi net home. Other machines (Wii) connected via wi - fi can enter Internet - I

  • Unregister the Netflix

    I have the Sony Internet TV and a Netflix account. I clicked sign upward to an account on the Netflix app and now it won't let out me. I tried to remove data from the Netflix app but it still load to the top of the screen with no option to go backwar

  • VGP-PRZ20 docking station not able to withdraw

    When I press the LOGOUT button, I get two error messages. One of them reads "before you unplug or turn off the AMD XGP docking station, make sure that you close the applications that run on the accelerated screens. Do you want to continue? "The other

  • Windows Update failed: Code 8024200d

    By default, rename %system%\C:\Windows\SoftwareDistribution will remove the update history but not the list of installed updates. ~ Robear Dyer (PA Bear) ~ MS MVP (that is to say, mail, security, Windows & Update Services) since 2002 ~ WARNING: MS MV

  • I couldn't activate the quick user change after I disabled it. Where can I find vrlogon.dll to remove?

    I have a professional operating system from XP.  I had to disable the quick change of user for a program to work. Now, I want to activate the fast user switching, but all options on the screen appear in gray.  An error message told me to delete vrlog