How do I email PDF file location to co-workers

New Here ,
Jul 27, 2018

Copy link to clipboard

Copied

Hi Everyone,

Our form requires about 5 different people to look at it, one after the other.  I set up a button for each person to press, once they sign it, to email a copy of the form along to the next person.

Rather than sending a copy of the form via email, I'd like to have the button email the PDF file's location to the next person in line.  We all have a shared network so no problem regarding that.  I'm just not sure what I need to write in order to get this done!

Any suggestions would be a appreciated!

TOPICS
Acrobat SDK and JavaScript, Windows

Views

183

Likes

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

How do I email PDF file location to co-workers

New Here ,
Jul 27, 2018

Copy link to clipboard

Copied

Hi Everyone,

Our form requires about 5 different people to look at it, one after the other.  I set up a button for each person to press, once they sign it, to email a copy of the form along to the next person.

Rather than sending a copy of the form via email, I'd like to have the button email the PDF file's location to the next person in line.  We all have a shared network so no problem regarding that.  I'm just not sure what I need to write in order to get this done!

Any suggestions would be a appreciated!

TOPICS
Acrobat SDK and JavaScript, Windows

Views

184

Likes

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
Jul 27, 2018 0
Adobe Community Professional ,
Jul 27, 2018

Copy link to clipboard

Copied

There is a JavaScript function for just sending an email. Use this to send the link.

app.mailMsg();

Look it up here:

Acrobat DC SDK Documentation

Likes

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
Reply
Loading...
Jul 27, 2018 0
Most Valuable Participant ,
Jul 28, 2018

Copy link to clipboard

Copied

Is the problem that you don't know how to write a network location (like \\groupserver\sharename\directory\file.pdf?) or something else?

Likes

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
Reply
Loading...
Jul 28, 2018 0
New Here ,
Jul 29, 2018

Copy link to clipboard

Copied

Yes, I'm struggling with writing the network location. 

My idea was for my coworkers press a button, the email prompt pops up with the file pathway in it and they click the send button on the email prompt.

I have it currently set up to have them press a button, and email prompt pops up with the PDF as an attachment, and they click the send button on the email prompt.

With the current setup, it has copies of the file sent everywhere, I want everyone to get links to the original to take notes upon and sign.

Likes

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
Reply
Loading...
Jul 29, 2018 0
Most Valuable Participant ,
Jul 29, 2018

Copy link to clipboard

Copied

If you go to File > Properties you can see the file location half way down the Summary section. Add the file name to that, and you have something you can email, unless it has a drive letter.

Likes

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
Reply
Loading...
Jul 29, 2018 0
New Here ,
Jul 29, 2018

Copy link to clipboard

Copied

Yes I understand that, I'm trying to get javascript suggestions so my coworkers press a button and the location is already in the email that pops up once the button is pressed.

Likes

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
Reply
Loading...
Jul 29, 2018 0
Adobe Community Professional ,
Aug 01, 2018

Copy link to clipboard

Copied

You can covert the path to the current document into a platform path (i.e. a path that can be used on the particular system) with this code

Collab.convertDIPathToPlatformPath(this.path);

This function can be used with the app.mailMsg() function to build an email mail with a local network link to the document.

something as simple as this will work as a button script.

app.mailMsg({bUI:true,cTo:cTargetEmail, cSubject:"Form to fill out", cMsg:Collab.convertDIPathToPlatformPath(this.path)});

the cTargetEmail variable is a placeholder for the email of the next person who needs the form.

Likes

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
Reply
Loading...
Aug 01, 2018 0
Most Valuable Participant ,
Aug 01, 2018

Copy link to clipboard

Copied

That won't work, because this function requires a trusted context. They'll have to use it from a folder-level script...

It's not too complicated to write your own function that converts the DI path to a normal one, though, through some string manipulations.

Likes

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
Reply
Loading...
Aug 01, 2018 0
New Here ,
Aug 01, 2018

Copy link to clipboard

Copied

Thom,

Thank you so much for the suggestion, but I just tried copying and pasting the app.mailmsg string you posted on the forum and it didn't work for me.  Maybe I'm doing it wrong, or we need a specific type of server situation?

I was able to do a really clunky workaround though.  It doesn't give a hyperlink, but a HTML string they can cut and paste that will bring them to the folder they need:

var cMyMsg = "Located:\n\n";

cMyMsg += "LAN:/Shared by Departments/Returned Goods/2018/Form to fill out" + "\n\n";

cMyMsg += "Please copy and paste this hyperlink into the Window Explorer to navigate to the file.";

app.mailMsg({

bUI: true,

cTo: "johndoe@example.com",

cSubject: "Form to fill out"

cMsg: cMyMsg

   } );

Likes

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
Reply
Loading...
Aug 01, 2018 0
Most Valuable Participant ,
Aug 01, 2018

Copy link to clipboard

Copied

It will never be a hyperlink, unless your email client interprets it as one on its own. Emails created using a script will always be plain-text only.

Likes

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
Reply
Loading...
Aug 01, 2018 0
Adobe Community Professional ,
Aug 01, 2018

Copy link to clipboard

Copied

If the email is received by MS Outlook, then it is likely that the URL will be interpreted as a link. But this is based on the local settings. The other option is to get fancy and create HTML email content.

I missed that the conversion function is privileged. That is totally unnecessary and unexpected. One solution is for you to do the conversion manually in Acrobat Pro from the console window and paste it into the form.  However, since you have a closed system, you could install a short folder level script on all the systems that use the form.   Another solution is to just write a file path converter for your network paths.

A simple one for Windows is this.

var myPath = "\\" + this.path.replace(/\//g,"\\");

This only works for Network paths on Windows.

Likes

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
Reply
Loading...
Aug 01, 2018 0
Most Valuable Participant ,
Jul 30, 2018

Copy link to clipboard

Copied

The path is returned in document.path but it is not in the same format; you’d need to transform it carefully.

Likes

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
Reply
Loading...
Jul 30, 2018 0