AI extraction of email attributes

When you send a PDF by email from pdfMachine, AI extraction reads the first page of the document and fills in the email for you: the name of the attachment, the subject line, a short message body and, if the page shows who the document is addressed to, the recipient's email address. An invoice printed from your accounting program goes out as "Invoice 10234 Acme Supplies March 2026.pdf" with the subject "Invoice 10234 from Acme Supplies", a polite covering note and the customer's address already in the To field.

The option is found under Options | Email | AI Extraction of Email Attributes. It is set per printer. It is available in the registered office, pro and ultimate editions of pdfMachine; see the prices page. It is the email counterpart of AI filenaming and uses the same AI credits.

Two ways to use it

  • Automatically. Tick AI Extraction enabled on the Email options page. From then on, every time pdfMachine is about to email a PDF, it asks the AI first and uses the answers as the starting values of the email. This applies to File | Send Email in the viewer, to the "Launch default email client" next action and to the one-shot email after printing.
  • On demand. The pdfMachine compose email window has an Auto fill using AI button next to Send. Click it to fill in all four attributes for the current PDF, whether or not the automatic option is on. Anything you have already typed in a field is replaced only where the AI returned something; a page with no recipient address leaves your To field alone.

How it works

  1. You choose to send the PDF by email, or click Auto fill using AI.
  2. pdfMachine extracts the text of the first page only of the PDF. Only the first few thousand characters are used.
  3. That text is sent over an encrypted (https) connection to the broadgun.com server, together with your pdfMachine licence details, the language of the pdfMachine user interface and your Windows locale (so that dates and amounts are written the way you are used to seeing them).
  4. The broadgun.com server passes the text to Google's AI, which suggests the attachment name, subject, body and recipient in the language the document is written in.
  5. pdfMachine checks the suggestions: the attachment name is made a valid Windows filename, the recipient must be a single well-formed email address, and the body is turned into simple paragraphs so it looks right in every email program.
  6. The values are then used exactly as if you had typed them into the Email options page. Which of the four are used is up to you; see Extraction settings.

A small progress window is shown while the server is being asked; the request normally takes a few seconds. If the first page has no text (for example a scanned image without OCR), if the server cannot be reached or if you cancel, the email is prepared with its usual values and nothing is lost.

What happens to the values

The AI's answers take the place of the values that would otherwise come from the Email options page. Where the AI returns nothing for an attribute, for example no address on the page, the normal value is used instead.

  • Attachment name replaces the configured attachment name or the document's filename. If "Prompt to confirm attachment name" is ticked, the prompt shows the AI's name and you can still change it.
  • Subject and body replace the configured subject and body. The body is short: a greeting, one or two paragraphs about the attached document, and a closing line. It does not sign off with a name, because the AI is told not to invent details that are not on the page.
  • To address is used only when the page itself shows an address for the recipient. The sender's own address, when it appears on the page, is deliberately not used.

If your send method opens the pdfMachine compose window (Extended MAPI, SMTP, Gmail API and Outlook.com API), the values are shown there for you to review and change before sending. With Outlook and Simple MAPI the email is handed to your email program with the values filled in. If "Automatically send email if To address is set" is ticked and the AI found a recipient, the email is sent without further prompting, so take care with that combination.

What is sent to the server

Only the text of the first page is sent. The rest of the document, and the PDF itself, stay on your computer. Nothing is sent when the option is off and the button is not clicked. If a document should not leave your computer even in this limited form, leave the option off for that printer, or set up a second pdfMachine printer with the option off and send sensitive documents from that one.

AI credits

Each extraction uses one AI credit from your pdfMachine account, whether it was automatic or from the button; clicking the button on an email that was already filled in automatically uses a second credit. The credits are shared with AI filenaming. The number of credits you have left is shown on the Email options page and is updated after every call, so it reads "not yet known" until the first call. When the account runs out of credits, pdfMachine opens a web page explaining how to top up. Until then emails are simply prepared with their usual values.

Options

AI Extraction enabled Turns automatic extraction on or off for this printer. In an unregistered copy of pdfMachine the box cannot be ticked. The Auto fill using AI button in the compose window works regardless of this setting.
Extraction settings Opens the Extraction settings window.
AI credits remaining The credit balance as last reported by the server. See AI credits.

Extraction settings

Prompt The "prompt" is the instruction sent to the AI along with the page text. pdfMachine has a built-in prompt that describes each of the four attributes: a short descriptive attachment name, a concise subject, a polite body of a greeting, one or two paragraphs and a closing line, and the recipient's address if the page shows one. You can replace it with your own, for example to always write in a particular language, to use your company's house style for the body, or to put a reference number first in the subject.

Put {text} where the page text should go; if it is absent the text is added at the end. Put {lang} where you want the two-letter code of the pdfMachine user interface language and {locale} for your Windows locale, such as en-AU. Whatever the prompt says, the AI is always asked to answer with the same four named values, so pdfMachine can read the reply. The prompt may be up to 2000 bytes long. Reset to default returns to the built-in prompt; saving the unchanged default stores nothing, so any later improvements to the built-in prompt apply automatically.
Set attachment name
Set subject
Set email body
Set 'to' address
Which of the four attributes the automatic extraction is allowed to fill in. All four are on by default. Untick, for example, Set 'to' address if your emails always go to a fixed address configured on the Email options page, or Set email body if you use a standard body with your signature. The Auto fill using AI button always fills in all four.

Examples

  • You print an invoice and choose File | Send Email. The email opens addressed to the customer's accounts address printed on the invoice, with the subject "Invoice 10234 from Acme Supplies", a two-paragraph note giving the amount and the due date, and the PDF attached as "Invoice 10234 Acme Supplies 12 March 2026.pdf".
  • You print a quotation for a customer whose address is not on the document. The subject, body and attachment name are filled in; the To field is left for you to complete.
  • You have a pdfMachine printer set up to send every document to your bookkeeper, with "Automatically send" on. Untick Set 'to' address so the AI only improves the subject, body and attachment name and the emails keep going to the bookkeeper.

Notes

  • The attachment name always ends in ".pdf". Characters that are not allowed in Windows filenames are removed from the suggestion and very long suggestions are shortened.
  • The body is plain paragraphs. To add a signature, a logo or other fixed content, untick Set email body and use the HTML email body on the Email options page instead, or edit the body in the compose window before sending.
  • The values are chosen from the document's first page, so documents whose first page is a cover sheet or a fax header may get less useful results. Consider putting the important information on the first page.
  • AI extraction is skipped when pdfMachine is running silently inside another application, and does not apply to mail merge.
  • The setting is separate for each pdfMachine printer. See multiple pdfMachines with different options.