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

PDF form, with Java script to send a mail, and to flatten the document

New Here ,
Mar 05, 2025 Mar 05, 2025

Good day Guys,

I need some advice and or assistance, i have created a simple filable form, for users to complete and submit the form to a specified email account and to cc in another email, i have also set the script to flatten the form before sending the form, so the form is not editable once the recipient receives the form.

 

the form is working perfectly on my PC using Adobe DC pro ( subscription), but once the form is shared with another user using Adobe ( non subscription) the form does not want to open the script to send the email.

 

Any advice would be apreciated

TOPICS
JavaScript , PDF forms
895
Translate
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
New Here ,
Mar 05, 2025 Mar 05, 2025

Hi have inculed the script if this will help at all

 

// Define the target email and CC email
var targetEmail = ;
var ccEmail = "; // Replace with the desired CC email address

// Update the subject line to include "HP Warranty Collection," the Shipper Name, and the Supplier Reference Number
var subjectLine = "HP Warranty Collection: " + this.getField("Shipper Name_2").valueAsString + " - " + this.getField("Supplier Reference Number_2").valueAsString;

// Add a message for the email body
var messageBody = "Dear Team,\n\nPlease find the warranty collection details attached.\n\nThank you!";

// Flatten the form fields to make them static (non-editable)
this.flattenPages();

// Send the email with the subject and message, including the flattened form as an attachment
this.mailDoc({
cTo: targetEmail, // To email address
cCc: ccEmail, // CC email address
cSubject: subjectLine, // Subject line for the email
cMsg: messageBody // Body of the email
});

Translate
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 ,
Mar 05, 2025 Mar 05, 2025

flattenPages will not work in the free Acrobat Reader.

Translate
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
New Here ,
Mar 05, 2025 Mar 05, 2025

Hi, Bernd, thank you for the reply, i did not know this, do you perhaps have an alternative solution for me to submit the form so that the recipient is not able to edit the same ?

Translate
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 ,
Mar 05, 2025 Mar 05, 2025

Set the form fields as read-only.

Translate
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
New Here ,
Mar 05, 2025 Mar 05, 2025

this does not resolve my problem😟!!!, i have removed "this.flattenPages();"from the script, and set the fields to read-only, but once the form is sent, the form is still editable on the recipients end, the mail goal is to be able to send out the fillable form to clients to complete, but once the form is "submitted" to a specified email account, the form should not be editable 

Translate
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 ,
Mar 05, 2025 Mar 05, 2025

Protect the form and allow form filling.

Translate
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 ,
Mar 05, 2025 Mar 05, 2025
LATEST

Use a digital signature field and set it as required, so the user must sign the file before submitting it.

Under the field's Properties, in the Signed tab, you can set it to lock all the other fields in the file.

Translate
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