Skip to main content
Participating Frequently
November 27, 2023
Question

mailDoc/Form and cSubLine += "-" + currentTime;

  • November 27, 2023
  • 1 reply
  • 472 views

i have 3 questions.

 1. i found an old forum post that said "mailForm" dosnt work with acrobat XI, i did sometesting and it works with pro and not acrobat reader DC, is there a way to make it work for the free version? tought i might test my luck since the post is 10 years old, and surely they fixed it by now.  :,)

 

2. i get the same problem with this scipt

 

var cSubLine = "Test " + cDate;

var currentTime = getCurrentTime();

cSubLine += "-" + currentTime;

 

it works when submiting on the pro version but not the free one. any suggestions?

 

3. and is there away to change the title of the pdf or fdf when subiting the form?

iv tried this

 

// Customize the filename with the desired format

var customFileName = "CustomPrefix";

// Set the document title this.info.Title = customFileName;

This topic has been closed for replies.

1 reply

Thom Parker
Community Expert
Community Expert
November 27, 2023

If you examine the Reference entry for the "doc.mailForm" function you'll see that it requires "Form Rights" to work in Reader:

https://opensource.adobe.com/dc-acrobat-sdk-docs/library/jsapiref/doc.html#mailform

 

There  is no such built-in function as "getCurrentTime();".  You must have this defined in a document or folder level script.  So can't say anything about it. 

 

The only way to change the file name of the FDF or PDF is to save it to a new name, then submit that PDF. 

 

 

Thom Parker - Software Developer at PDFScriptingUse the Acrobat JavaScript Reference early and often
Participating Frequently
November 28, 2023

1 could you elaberate on the mailForm requiring Form Rights?  do you mean bUi? i couldnt find anything about getting it to work with the reader version.

 

 

2 i got the scipt working in the doc lvl scipt, thanks!

 

 

3 thats a shame 😞

Thom Parker
Community Expert
Community Expert
November 28, 2023

"Reader Rights", also called "Reader Extensions", are a kind of special sauce that is applied to a PDF, which then allows Reader to do things with that PDF that it wouldn't normally do. 

Some of rights are free, but most cost a small fortune. It's an enterprise thing.  You can save a PDF with the free rights from Acrobat Pro. Look on the SaveAs Other... menu. One of these is form rights, but I'm not sure if it's the right kind. 

 

Another way to do this is to use the "doc.submitForm()" function with an email URL. 

 

 

 

 

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