Java Script changes my form to FDF, how do I send as PDF?

New Here ,
Jan 09, 2019

Copy link to clipboard

Copied

I have a java script that I use to submit a form to 2 different addresses depending on a certain field.

But when it send the form it sends as an FDF not a PDF; I need it sent as a PDF.

How do I ensure it is sent as a PDF not an FDF?

I am an absolute novice at java script so any help would be appreciated.

thanks in advance

R.Keev

var addr= "";

if (this.getfield("DropDown1").value=="Yes")

{

addr="1stmaillist@whatever";

}

else

{

addr="2ndmaillist@whatever";

}

This.submitform("Mailto:" + addr);

Most Valuable Participant
Correct answer by try67 | Most Valuable Participant

No, do it like this:

this.submitForm({cURL: "mailto:" + addr, cSubmitAs: "PDF"});

TOPICS
Acrobat SDK and JavaScript, Windows

Views

74

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

Java Script changes my form to FDF, how do I send as PDF?

New Here ,
Jan 09, 2019

Copy link to clipboard

Copied

I have a java script that I use to submit a form to 2 different addresses depending on a certain field.

But when it send the form it sends as an FDF not a PDF; I need it sent as a PDF.

How do I ensure it is sent as a PDF not an FDF?

I am an absolute novice at java script so any help would be appreciated.

thanks in advance

R.Keev

var addr= "";

if (this.getfield("DropDown1").value=="Yes")

{

addr="1stmaillist@whatever";

}

else

{

addr="2ndmaillist@whatever";

}

This.submitform("Mailto:" + addr);

Most Valuable Participant
Correct answer by try67 | Most Valuable Participant

No, do it like this:

this.submitForm({cURL: "mailto:" + addr, cSubmitAs: "PDF"});

TOPICS
Acrobat SDK and JavaScript, Windows

Views

75

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
Jan 09, 2019 0
Adobe Community Professional ,
Jan 09, 2019

Copy link to clipboard

Copied

Specify this with the parameter cSubmitAs. Look at the documentation of the method submitForm.

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...
Jan 09, 2019 0
New Here ,
Jan 09, 2019

Copy link to clipboard

Copied

Thank you Bernd Alheit for the assistance. So do I change it to;

this.cSubmitAs(PDF,"Mailto:" + addr);

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...
Jan 09, 2019 0
Adobe Community Professional ,
Jan 09, 2019

Copy link to clipboard

Copied

Use this.submitForm with the parameter cSubmitAs.

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...
Jan 09, 2019 0
Most Valuable Participant ,
Jan 09, 2019

Copy link to clipboard

Copied

You also have multiple other errors in your code related to lower/upper-case letters, so I assume you re-typed it instead of copying and pasting it, as the code you posted will not work at all.

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...
Jan 09, 2019 0
New Here ,
Jan 09, 2019

Copy link to clipboard

Copied

Yes try67 I re-typed it (I am awful at spelling with a capital O). the original code worked but the attachment it created to mail was an FDF not a PDF. But thank you for your assistance

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...
Jan 09, 2019 0
Most Valuable Participant ,
Jan 09, 2019

Copy link to clipboard

Copied

No, do it like this:

this.submitForm({cURL: "mailto:" + addr, cSubmitAs: "PDF"});

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...
Jan 09, 2019 2
New Here ,
Jan 09, 2019

Copy link to clipboard

Copied

Thank you again Try67; working great!!

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...
Jan 09, 2019 0