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

Sending e-mail with instant Acrobat links

Explorer ,
Nov 06, 2023 Nov 06, 2023

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
});

TOPICS
Create PDFs , How to , JavaScript , Modern Acrobat , PDF , PDF forms
387
Translate
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 ,
Nov 06, 2023 Nov 06, 2023
LATEST

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 PDFScripting
Use the Acrobat JavaScript Reference early and often

Translate
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