How to Create Bold Text in an Acrobat JavaScript Email
Question details
The user wants to format selected words in the body of an automated email generated via Acrobat JavaScript to appear in bold.

- Product
- Adobe Acrobat
- Device & OS
- not provided
- Scenario
- Generating automated emails from a PDF document using JavaScript and attempting to apply rich-text formatting to the message body.
- Observed behavior
- The standard JavaScript method in Acrobat is generating plain-text emails, and the user needs a way to apply bold text formatting.
Determine whether your workflow strictly requires the email body itself to be formatted, or if attaching a fully formatted PDF document to a standard plain-text email will suffice.
Use an External Mail System for HTML Emails
Since standard Acrobat JavaScript functions only output plain text, you must use an external server-side script to send formatted HTML emails.
The built-in mailDoc and app.mailMsg methods in Acrobat JavaScript are specifically designed to generate plain-text emails. They do not support rich-text formatting, meaning you cannot use bold text, italics, custom fonts, or colors directly through the Acrobat API.
To bypass this limitation and send formatted content, you need to configure your PDF form to submit data to an external server-side script (such as PHP or Node.js) that is capable of constructing and sending an HTML-formatted email.
Understand that adding HTML tags like <b> or <strong> directly into Acrobat's mailDoc method will not work; the tags will simply appear as raw text in the recipient's email.
Create a script on your web server (using PHP, Python, etc.) that accepts form data and uses a mailing library to send an HTML-formatted email.
Use Acrobat's submitForm() JavaScript method inside your PDF to send the required form field data to your external server URL instead of generating the email locally.
Have your server-side script parse the incoming PDF data, construct an HTML email body with the necessary bold styling, and dispatch it to the recipient.

Format and Share Documents Directly with WPS Office
While automated email formatting via PDF JavaScript can be restricted and overly complex, WPS Office provides a powerful built-in PDF editor. You can easily apply bold formatting directly within your document and seamlessly share it as an attachment without worrying about plain-text email limitations.
- 1. Download WPS Office: Install the free version of WPS Office from the official website.
- 2. Open your PDF: Launch WPS PDF and open the document you wish to format.
- 3. Format your document: Navigate to the Edit tab to apply bold styling and other formatting directly to your PDF content.
- 4. Share via email: Click the 'Share' or 'Email' button to attach your beautifully formatted PDF to an email, bypassing plain-text body limitations.

Frequently Asked Questions
Can I use HTML tags inside Acrobat JavaScript's mailDoc method?
No, the mailDoc method only interprets plain text. If you include HTML tags like <b> or <i>, they will not render as formatting and will be displayed as raw text in the final email body.
Does the app.mailMsg method support rich text?
Just like the mailDoc method, app.mailMsg is restricted to plain text. It cannot apply bold formatting, hyperlinks, or other rich-text styles to the email message.
Are there any Acrobat plugins to enable rich text in automated emails?
Acrobat itself does not natively support rich-text email generation via JavaScript plugins. For formatted emails, you must rely on external server-side processing or dedicated third-party email APIs.




