anshuman shinde
anshuman shinde

Reputation: 11

Add an attachment to mailto link in PDF

I'm trying to add a mailto link in a pdf document that opens a new email with the said document as an attachment. Is this possible? I have already added the subject and body of the mail.

Upvotes: 0

Views: 2372

Answers (1)

joelgeraci
joelgeraci

Reputation: 4917

The mailto: protocol does not support attachments at all, PDF or otherwise. However, in Acrobat JavaSCript which is supported by a few other viewers, you can use a JavaScript Action to create a new mail message with the document attached. You can set a bunch of parameters like in the second example or just call...

this.mailDoc(true)

... to create a new blank message with the document attached.

Example 2:

this.mailDoc({
  bUI: false,
  cTo: "[email protected]",
  cCC: "[email protected]",
  cSubject: "Your Subject line",
  cMsg: "Email body message."
});

Note: This code will not work in all PDF viewers and it is unlikely to work in browsers or on mobile. You'll need to test it in your specific use cases.

Upvotes: 1

Related Questions