• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
0

Emailing a File

Explorer ,
Aug 08, 2019 Aug 08, 2019

Copy link to clipboard

Copied

Greetings - I am in hopes that someone might be able to assist in helping me Save a file, with a new name, to a temp folder (?), and then possibly attach the newly renamed file to an email.

I already have some code (found here - thanks Thom Parker!) that works as should. Now what I am looking to do, is rename the file and email the renamed file.

Here is my email code:

{

// To email adresss

//var cToAddr = "email@email.com";

var cToAddr = "email@email.com";

// BCC email address

var cBCCAddr = "email@email.com";

// Set the subject for the email message

var cSubLine = "Donation Acceptance - " + this.getField("Name").value + " - " + this.getField("Today").value + "";

// Set the body text for the email message

var cBody = "Attached is a new Donation Acceptance Acknowledgement from " + this.getField("Name").value + " " + "for your review.\n\n" + "Thank you." + "\n\n"

// Send the entire PDF as a file attachment on an email

this.mailDoc({bUI: true, cTo: cToAddr, cBcc: cBCCAddr, cSubject: cSubLine, cMsg: cBody});

Anyone know how to Save the file with a new file name, and attach the renamed file to the message; rather than the current opened file?

TOPICS
Acrobat SDK and JavaScript

Views

178

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Aug 09, 2019 Aug 09, 2019

Copy link to clipboard

Copied

LATEST

Read this tutorial: https://acrobatusers.com/tutorials/how-save-pdf-acrobat-javascript

In short, in order to be able to do it you must run the code from a js file that's installed on the local machine, or certify your file first.

Also, it can't create folders, only use existing ones.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines