Solved

JavaScript doesn't put subject in email with Adobe Acrobat 9

Posted on 2009-07-02
7
488 Views
Last Modified: 2012-05-07
We just upgraded from Adobe Acrobat 8 Pro to version 9.  We have a document that uses javascript to email the .pdf to other people when it is digitally signed.  In Actrobat 8, the subject line was automatically filled in to be "Document_name.pdf - Adobe Acrobat Professional".  Now the email still comes up, but it doesn't automatically fill in the subject.  I have included the line of code in question.  Is there a way to change the javascript to put the document name in the subject line?  Thanks for your help.
this.mailDoc(false, "pendingOPS@navy.mil","", "", "", "Signed by NetOps.  Forwarded for Final review and Approval.")

Open in new window

0
Comment
Question by:laugle
  • 4
  • 3
7 Comments
 
LVL 15

Expert Comment

by:mohan_sekar
ID: 24794239
Yes, the 5th parameter is for the 'Subject'

this.mailDoc(false, "pendingOPS@navy.mil","", "", "This is email subject", "Signed by NetOps.  Forwarded for Final review and Approval.")
0
 

Author Comment

by:laugle
ID: 24794342
OK -- but our document has a different name each time it is sent out, and I don't want to change the code every time.  What code do I use to get it to put each different document's name in the subject line?  For example, in MS Active Directory, when you are creating a home directory, you can use the generic string %username% to specify a directory with the user's specific username.  Is there some code in Adobe that does something like this?  Or do you know what changed in Adobe 9 that stops the program from doing this automatically?  Is there some setting that will bring this functionality back?  Thanks again for any help.
0
 
LVL 15

Expert Comment

by:mohan_sekar
ID: 24794513
document.documentFileName() will get you the document name. Then, the statement changes to

this.mailDoc(false, "pendingOPS@navy.mil","", "", document.documentFileName() + " - Adobe Acrobat Professional", "Signed by NetOps.  Forwarded for Final review and Approval.")
0
U.S. Department of Agriculture and Acronis Access

With the new era of mobile computing, smartphones and tablets, wireless communications and cloud services, the USDA sought to take advantage of a mobilized workforce and the blurring lines between personal and corporate computing resources.

 

Author Comment

by:laugle
ID: 24794885
I have tested this on my document.  I have tested just putting a constant in the parameter, and that works.  When I put document.documentFileName() in the 5th parameter, the mail message will not come up.  I also tried to set a variable using var filename=document.documentFileName(); and then using the variable filename as the parameter, but the mail message won't come up with that either.  Somehow, my document will not recognize the code  document.documentFileName().  It's been a while since I've programmed in Java proper, but could this be failing because there is no API import statement at the start of the script?  I've never seen an import statement in an Adobe javascript -- is it possible to use an import statement?  If you want to see the whole javascript, I can attach it.
0
 
LVL 15

Accepted Solution

by:
mohan_sekar earned 250 total points
ID: 24795117
My bad. That API was for an older version of Adobe! Try this

this.mailDoc(false, "pendingOPS@navy.mil","", "", this.documentFileName + " - Adobe Acrobat Professional", "Signed by NetOps.  Forwarded for Final review and Approval.")
0
 

Author Comment

by:laugle
ID: 24795424
Thanks - that worked beautifully!  You're the best!
0
 
LVL 15

Expert Comment

by:mohan_sekar
ID: 24795451
Glad I could help!
0

Featured Post

Problems using Powershell and Active Directory?

Managing Active Directory does not always have to be complicated.  If you are spending more time trying instead of doing, then it's time to look at something else. For nearly 20 years, AD admins around the world have used one tool for day-to-day AD management: Hyena. Discover why

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
rhino JavaScript import, load 25 83
How to open a zip file 4 83
How can I convert HTML files to .pdf files? 9 56
Cannot Set Default PDF Reader Windows Server 2012 RDS 13 105
Update 21-May-2015: I temporarily removed the source code to make major changes to the program. Regards, Joe In a previous Experts Exchange article, How To Rename-Move a Batch of PDF Files Based on Contents of the Files (http://www.experts-exchan…
This article focuses on how to remove password security from multiple PDF files by Adobe Acrobat program. Sometimes it is essential to access the stored data items and to print, edit as well as copy content from Portable Document Format files in abs…
Viewers will learn about the regular for loop in Java and how to use it. Definition: Break the for loop down into 3 parts: Syntax when using for loops: Example using a for loop:
In this sixth video of the Xpdf series, we discuss and demonstrate the PDFtoPNG utility, which converts a multi-page PDF file to separate color, grayscale, or monochrome PNG files, creating one PNG file for each page in the PDF. It does this via a c…

773 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question