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

save as variable name, then flatten, then email

Community Beginner ,
Aug 18, 2020 Aug 18, 2020

Copy link to clipboard

Copied

Maybe I'm expecting too much but was wondering if pdfs and javascript would be able to do this.

I have a form that I would like to have it do the following.

  1. Do a "save as" to a specific folder using the date from the date field and name from the name field
  2. After saving to the specific folder with the new name, this new form would be flattened
  3. The submit button to this new form would be removed

 

This may not even be possible but I thought I'd ask. Thanks!

TOPICS
Acrobat SDK and JavaScript

Views

316

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 18, 2020 Aug 18, 2020

Copy link to clipboard

Copied

Depending on the type of workflow that you want to employ it is possible with JavaScript.

 

You can create an button with  mouse-up action and employ a similar script to the different methods discussed in this tutorial by Thom Parker: How to Save a PDF with Acrobat JavaScript 

 

The tutorial above explains and discuss all the considerations needed to change file name and handlig directory paths conventions. It also discusses how to save to a postscript file to completely flatten and remove PDF features from the document during the  Save As procedure. You'll need to add  a script to  make the  button field not visible before it is saved as a postscript.

 

You'll also need to add an emailing script to that action button which is really not that hard.

 

You can do that part like this:

 

//leaving the From and To addresses empty with a space between the quotes will open up the address book automatically

var cFromAddr = " ";
var cToAddr = " ";

//or spcify the From and To email addresses to automate this workflow

var cFromAddr = "myemail@company.com";
var cToAddr = this.getField("EmailAddress").value;




// concatenate your date field and the Form fieldnames to the message in the subject line to appear as the filename sent in this attachment

var cSubLine = "Please see attached file" + " for the End of Month Gross Profit Report, " + this.getField("myFormName").value + " - " +  this.getField("myFormDateField").value;
var cBody = "You can customize your email mesage here."



//execute some actions , hide the button field and send email

this.getField("myButton").display = display.hidden;
this.mailDoc({bUI: true, cTo: cToAddr, cFromAddr: cFromAddr, cSubject: cSubLine, cMsg: cBody});

 

 

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
Community Beginner ,
Aug 18, 2020 Aug 18, 2020

Copy link to clipboard

Copied

Thank you for your advice. This form is for large animal veterinarians with the results of their on farm herd visits. They've got little to no patience with this sort of thing so whatever I do I need to make it easy for them. I'll give your suggestions a try and see what I can come up with. Hoping it will work with Reader. Thanks again. 

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
Community Expert ,
Aug 18, 2020 Aug 18, 2020

Copy link to clipboard

Copied

Saving the file under a specific name requires installing a script on the local machine of each user.

Flattening the file requires all the users to have Acrobat, not just the free Reader.

Also, it's not clear from your description whether you want to mail the form, or to disable the Submit button (or both)...

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
Community Beginner ,
Aug 18, 2020 Aug 18, 2020

Copy link to clipboard

Copied

thanks for your reply. I would like to email it. thinking of different options..This may just be going off the deep end to nowhere. I really don't know what I'm doing.

It might be an easier and safer method that as soon as the original doc is opened, a save as dialogue box will open and ask them where they want to save it before they go further. (this may eliminate the permissions script thing since its user-initiated)  Then they can fill it out, press the submit button, have it flatten and be sent out. through outlook. 

Since these are veterinarians, this would have to be something of a legal document that once its completed by the vet, it can not be changed. 

I honestly don't know if any of this will work but if it doesn't, it would be nice if Adobe could make it happen. thank you

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
Community Expert ,
Aug 18, 2020 Aug 18, 2020

Copy link to clipboard

Copied

LATEST

Yes that is a lot easier to do.  

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