Skip to main content
JR Boulay
Community Expert
Community Expert
November 4, 2016
Answered

mail.doc send a blank form

  • November 4, 2016
  • 6 replies
  • 1051 views

Hi.

Extract from the JS-Reference:

mail.doc

Saves the current PDF document and mails it as an attachment to all recipients

I also noticed that Readers older than version XI(11) requires the form to be Right-Extended.

All is in the title.

Even from a Right-Extended form, it's always sent blank, tested with Adobe Reader 9, Acrobat Reader DC, Acrobat Pro DC and Acrobat Pro XI.

Is there a known issue or did I make something wrong?

Here is my script.

controle() is a function that check required fields so they cannot be sent empty, but they are blank in the email attachment, before sending the email.

// mailDoc

var ctrl = controle();

if(ctrl==true) {

    var fTo = "name\u0040example.com";

    var fSubject = "Questionnaire de satisfaction";

    var fBody = "Bonjour.\r\rCi-joint mes r\u00E9ponses au questionnaire.";

    this.mailDoc({bUI: true, cTo: fTo, cSubject: fSubject, cMsg: fBody});

    }

else

{app.alert("Blablabla");}

//

This topic has been closed for replies.
Correct answer try67

I think the issue is that on the MouseEnter event of Button2 you're setting the dirty property to false, so the file doesn't get saved before it is sent in the MouseUp command (which executes after MouseEnter). That's why you're getting a blank file...

6 replies

JR Boulay
Community Expert
JR BoulayCommunity ExpertAuthor
Community Expert
November 8, 2016

Because this form was originaly made by someone else who is currently unavailable.

So I'd prefer to keep my added scripts separate to leave her scripts untouched and simplify tracking in the future.

Acrobate du PDF, InDesigner et Photoshopographe
JR Boulay
Community Expert
JR BoulayCommunity ExpertAuthor
Community Expert
November 8, 2016

Arrggg! I feel so stupid, give me a shovel that I dig my gravecombat%20(109).gif*

The worst is that I cannot figure why this line is here, it's no use anywhere.

A copy-pasting bug I guess…

In any case it's even evidence that four eyes are better than two.

Giga thank you!

You saved me.

* Typical old french tradition

Acrobate du PDF, InDesigner et Photoshopographe
try67
Community Expert
Community Expert
November 8, 2016

:-)

PS. Validating the form on MouseEnter is not a very good idea. Why not simply incorporate it into the MouseUp code?

JR Boulay
Community Expert
JR BoulayCommunity ExpertAuthor
Community Expert
November 7, 2016
Acrobate du PDF, InDesigner et Photoshopographe
try67
Community Expert
try67Community ExpertCorrect answer
Community Expert
November 7, 2016

I think the issue is that on the MouseEnter event of Button2 you're setting the dirty property to false, so the file doesn't get saved before it is sent in the MouseUp command (which executes after MouseEnter). That's why you're getting a blank file...

JR Boulay
Community Expert
JR BoulayCommunity ExpertAuthor
Community Expert
November 7, 2016

Sure.

Here is the file: https://framadrop.org/r/KkgGP_Jw27#44D8IsdFr95WX7kIGmDGDro/Z2ikhkbm5J3bFDbaFzU=

Failing JavaScript is in "Button2" (mouse up).

First you need to clic on the right arrow to begin.

Then you must tick radio-buttons (required).

Clic on the right arrow again and fill the 2 text fields (not required).

Clic on the right arrow to finish, and clic the purple word "ici" to send via email.

Thank you.

Acrobate du PDF, InDesigner et Photoshopographe
try67
Community Expert
Community Expert
November 7, 2016

The file doesn't exist.

try67
Community Expert
Community Expert
November 6, 2016

The code looks fine. Can you share the actual file, or a sample file that demonstrates this issue?

JR Boulay
Community Expert
JR BoulayCommunity ExpertAuthor
Community Expert
November 6, 2016

???

Acrobate du PDF, InDesigner et Photoshopographe