Skip to main content
Known Participant
November 6, 2023
Question

Sending e-mail with instant Acrobat links

  • November 6, 2023
  • 1 reply
  • 483 views

I was writing the following Code to send a specific PDF Document in My Drive through e-mail. 

The Document has to be attached into the e-mail's body as a link.

the Script, of course, doesn't work because the link doesn't give access to any real Document. 

I'm trying to create a match between the text field NAME's value and the Document in My Drive. You see, the value written in the abovementioned textfield is the name of the Folder where the PDF Documents is located.

I know I should give the Script the path of the Document, I just don't know how to correct this Script

 

var Name = this.getField("NAME").value;
var linkURL = "https://acrobat.adobe.com/link/review?uri=urn:aaid:scds:US:" + generateUUID(); 

var cToAddr = "-----------@gmail.com";
var cSubLine = "Object " + Name;
var cBody = "Here's your link: " + linkURL;

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

This topic has been closed for replies.

1 reply

Thom Parker
Community Expert
November 6, 2023

The answer is no.  The Adobe Cloud came along many years after the doc.mailDoc() function was added to the Acrobat JavaScript Model.  In fact, the JS model hasn't been changed in any significant way in many years.  So there isn't any (documented) way to add docs to the Adobe Cloud or generate Adobe cloud links in JavaScript. 

Maybe, there is a REST API for this. I don't know if such a thing exists, but Adobe does provide a number of services through REST APIs.  If this capability does exist, then the NET.HTTP object in the Acrobat JS model could be used to save a document to the cloud and acquire a link to it.  

 

Thom Parker - Software Developer at PDFScriptingUse the Acrobat JavaScript Reference early and often