OCR email attachments: make scanned PDFs searchable automatically

OCR email attachments automatically: turn scanned PDFs and pictures into searchable PDFs or text, split scanned batches and read values from scans.

To OCR email attachments automatically, let Mail Attachment Downloader save them and run its Make PDFs searchable (OCR) step on each one. Scanned PDFs and pictures come out as searchable PDFs, plain text or a words file, on your own system, as the emails arrive. Its Split PDF step cuts a scanner’s batch into one PDF per document.

Scanned invoices, delivery notes and signed contracts often arrive as pictures of paper: you can’t search them or copy from them. The examples use Contoso’s mailbox finance@contoso.com and scanned invoices from Acme.

What you need

  • The edition: PRO Rules Server. OCR and Split PDF are steps in a PRO rule, and both need PRO Rules Server. The same edition runs the rules as a Windows service.
  • Windows: Windows 10 or later, 64-bit, on a PC, a server or a cloud VM.
  • The mailbox: Gmail, Google Workspace, Microsoft 365, Outlook.com, Exchange, or any IMAP or POP3 mailbox.

Step 1: A rule that saves the scanned attachments

On the PRO Rules tab, click New rule…. Under Which emails, click Add a condition and pick the emails with scans: the sender’s domain acme.example, the account your scanner sends to, or a mailbox folder. An attachment name condition of \.pdf$ keeps the rule to PDFs. Under Save, save the attachments to a folder such as D:\Finance\Scans.

New to PRO Rules? Save emails and attachments to folders walks through a first rule.

Step 2: Add the “Make PDFs searchable (OCR)” step

Under Then, click Add a step…, choose Files and double-click Make PDFs searchable (OCR). It adds a text layer to scanned PDFs and pictures.

The Add a step window with Files chosen: Copy file, Convert documents, Make PDFs searchable (OCR), Merge PDFs, Convert all files to a single PDF, Split PDF and Unzip
Add a step › Files: the OCR step and Split PDF sit with the other PDF steps.

Then set it up:

  • File name: where the result goes, such as {SAVE_PATH}\{FILENAME}_ocr, next to the saved scan. Don’t add an extension: .pdf, .txt or .json is added as the step saves. The attachment you saved stays as it is.
  • Engine: which OCR engine reads the pages (see the next section).
  • Language: empty means English. Type language codes joined with +, such as eng+deu for English and German.
  • “Only read pages that have no text”: a PDF that mixes typed pages and scanned pages keeps its typed pages as they are, and only the scans are read.
  • “Straighten pages before reading”: a crooked page is turned level, and a page scanned sideways or upside down is turned upright before it is read.
  • Save as: what the step makes (see below).

Click Test on a file… to read a scan of your own with these settings, then Open the test results folder to see the result. Word, Excel and other files are turned into page pictures first, so the step reads them too.

The Make PDFs searchable (OCR) step in the Rule Editor: file name {SAVE_PATH}\{FILENAME}_ocr, engine Tesseract 5 on this computer, language empty for English, Only read pages that have no text and Straighten pages before reading ticked, Save as A searchable PDF, and the Test on a file button
OCR email attachments from Acme with Tesseract 5, on this computer, into a searchable PDF.

Which OCR engine should you use?

The Engine list says where each engine runs: on this computer, or in the service it sends the pages to.

  • Tesseract 5: free and on your own system. Usually the most accurate choice that sends nothing anywhere. English, German, French, Spanish, Italian, Dutch and Polish are included; other languages need their language data file (such as por.traineddata) in the folder that Open the language data folder opens.
  • Tesseract 3.05: the engine earlier versions used; steps saved before keep it.
  • Windows OCR: free and on your own system. It reads the languages installed in Windows.
  • Azure AI Document Intelligence: Microsoft’s Read model, in your own Azure resource. Add it once under Settings › Sources › OCR Providers with the resource’s Address and Key; Test reads a built-in sample page, so nothing of yours is sent. Then pick “Azure Read” as the engine and your connection as the Provider. The pages go to Microsoft as pictures, under your own Azure account and prices.
  • AI vision: an AI model that reads pictures, such as OpenAI, Claude, Gemini or your own AI server, reads each page. It gives the text without its exact place on the page; a searchable PDF still holds the text, spread down the page, so it can be found and copied.

Keys are kept encrypted on your own system, never in a rule. A test with a cloud engine asks before it sends a page.

Searchable PDF, text or words file?

Save as offers three results:

  • A searchable PDF: looks just like the scan, with the text under the picture. Windows search, SharePoint and document management systems can find it, and you can select and copy the text.
  • Plain text (.txt): the text of each page, for a search index, a script or a database.
  • The words with their positions (.json): each word with its place on the page, for a later step or your own program.

How do you split a scanned PDF into separate documents?

A scanner often sends a whole stack of paper as one PDF. Add Split PDF (Add a step… › Files) to cut it up.

  • Split by pages: tick One file per page, or Only some pages to copy a range, such as page 1 to 2, to a new PDF.
  • Split into the documents it holds: a new document starts where the pages say so. Each page is read for its page marker, such as “1 of 2”, and a document ID, such as the invoice number. Under A new document starts, choose On a page whose marker reads 1 (1 of 2) or When the document ID changes.

For the documents mode, show the program where the marker and the ID are with Open in the extraction wizard…: highlight the value on a page. Read scanned pages with picks the OCR engine for pages that have no text; it lists the engines on your own system, so for a cloud engine put an OCR step before Split PDF.

Under Check each document, the step can check that each document has the pages its marker says, and that its pages share one ID. When a check fails, choose Hold the PDF for review: nothing is saved, so a missing page is caught before anything is filed. Try it on a PDF… shows where each document starts, without saving anything.

In the documents mode, the steps you put under Split PDF run once for each document, so each invoice can be named, read and uploaded on its own.

The Split PDF step in the Rule Editor: Split by pages with One file per page ticked, Only some pages with From page and To page, the option Split into the documents it holds, and the file name {SAVE_PATH}\{FILENAME}_{ID}_split.pdf
Split PDF: one file per page, a range of pages, or one PDF per document in a scanned batch.
Mail Attachment Downloader's Split PDF step on the rule Scanned invoices: Split into the documents it holds, scanned pages read with Tesseract 5, page marker and document ID fields, a new document when the ID changes, both checks on, and a PDF that fails a check held for review
Split PDF cuts a scanned batch into one PDF per invoice, read by OCR, and checks each one.
Try it on a PDF: a 6-page scanned batch acme-batch-1104.pdf cut into 3 documents, INV-2026-0423, INV-2026-0424 and INV-2026-0425, each 2 pages, every check passing
Try it on a PDF shows where a batch will be cut before the rule runs.

Read invoice values from scanned PDFs

Steps you put inside the OCR step work on the file it made. So a Find fields with AI step inside it can read the invoice number, due date and total from the searchable PDF, and the steps under that one can save them to a database, send them to a web hook, upload the file or send a notification.

A rule named Scanned invoices in the Rule Editor: Make PDFs searchable (OCR) with Find fields with AI inside it reading {INVOICE_NUMBER}, {DUE_DATE} and {TOTAL_INCLUDING_TAX} with the built-in AI model on this computer, and Save to a database, Web hook, Upload to cloud and Send notification under it
Read values from scanned invoices: OCR first, then the built-in AI model reads the fields, and nothing leaves this computer.

The Parser reads scans too. Add a scan as a sample with Add a file… and it is read by OCR; then highlight the values or describe them in plain words, add checks and pick where the values go. The rule the Parser saves puts an OCR step ahead of its reading steps. Building and checking a parser from scans works in PRO Parser; running it on scanned files needs PRO Rules Server. See extract data from emails and attachments.

The Parser's Source step with a scanned invoice INV-2026-0423.pdf as the sample, read by OCR, 18 lines
A scanned PDF as the Parser’s sample: it is read by OCR first.
The Parser's Fields step on a scanned Acme Office Supplies invoice: the invoice number INV-2026-0423, the date and the total 855.12 highlighted on the scan and listed as fields
Highlight the values on the scan, and the Parser finds them in every invoice like it.

Scans from a scanner folder, not email

Does your scanner save to a share instead of sending an email? With PRO Rules Client and up, a folder watch sends each new file in a folder or network share through your PRO Rules, as an email’s attachment does. Point it at \\nas\scans, and the same OCR and Split PDF steps run on the scans.

The Watch: Folder window for a folder or network share: folder \\nas\scans, Run as soon as something changes, 60 seconds between checks, Include the folders inside it ticked
A folder watch on the scanner’s share sends each new scan through your rules.

Run it around the clock

Install the Windows service with Schedule › Service schedule › Install service, and scans are read as they arrive, even when nobody is signed in. Each account’s History remembers what it has handled, so nothing is read twice.

Questions people ask

Can I OCR email attachments without sending them to the cloud?

Yes. Tesseract and Windows OCR run on your own system. Only Azure AI Document Intelligence and AI vision send pages out, to the account you set up.

Does OCR change the original attachment?

No. The step saves a new file with the name you give it. The attachment the rule saved stays as it arrived.

Can it OCR JPG, PNG and TIFF attachments?

Yes. The step reads pictures as well as PDFs, and can save each one as a searchable PDF.

Which edition do I need?

PRO Rules Server, for both Make PDFs searchable (OCR) and Split PDF. See pricing.

Try it: download Mail Attachment Downloader and start with the free edition, or compare the PRO editions, each with a 30-day money-back guarantee.

Related

Questions about this post? Contact us.

Export emails from Gmail and Microsoft 365 to PST, MBOX, EML or PDF

Export Gmail, Microsoft 365, Exchange or IMAP email to PST, MBOX, EML, MSG, PDF or ZIP, and import PST, MBOX and EML files back, step by step.

Need your mail as files? Maybe a PST for Outlook, an MBOX archive, or a PDF of each email for a lawyer or an auditor. Mail Attachment Downloader exports emails from Gmail and Google Workspace, Microsoft 365 and Outlook.com, Exchange, or any IMAP or POP3 mailbox to PST, MBOX, EML, MSG, PDF or ZIP.

It also works the other way: it imports PST, MBOX and EML files. This post shows both, with the names you see in the program.

What you need

  • PRO Backup or any edition above it. Export and Import are on the Backup tab. The Free edition shows that tab as a preview only.
  • Windows 10 or later, 64-bit. No Outlook or other email program is needed, not even to write a PST file: the program connects to the mail server itself.
  • The mailbox added with Add account. Gmail, Google Workspace, Microsoft 365 and Outlook.com sign in with your browser.

Step 1: back up the mailbox

Export doesn’t read the mail server. It writes the files from the account’s backup: an encrypted copy of the emails, kept on your own system. So the mailbox is backed up first. The full walkthrough is in Back up Gmail and Microsoft 365 email. In short:

  1. Open the Backup tab and pick the account with Change account.
  2. On the Configuration page, choose Its own and set Hold everything for to Forever (or as long as you need). An email with no copy in the backup can’t be exported.
  3. On the Run a backup page, click Back up now.

The first backup reads the account’s folders from its start date and copies each email. A big mailbox can take hours. You can stop it at any time, and the next run goes on where it stopped. For older emails, use Backfill emails… on the Downloads tab.

The Run a backup page of the Backup tab for finance@contoso.com, a Microsoft 365 account: 18,431 emails in the backup since 3/3/2019, the last backup an hour ago, the Back up now button, and how a backup works
Back up the mailbox first. Later runs add only the new emails.

Step 2: export the emails

  1. On the Backup tab, open the Export page.
  2. Under Which emails, choose The whole backup, Received between two dates, or Some folders and tick them, for example INBOX/Invoices.
  3. Under As, choose the format (see the next section).
  4. Under To, click Browse… and choose the folder, for example D:\Exports\Finance.
  5. Click Export. A line shows how far it got, and Stop ends it early.
  6. When it’s done, click Open the folder.

The files follow the mailbox’s folders. Each file is named by the date, time, sender and subject, such as 2026-11-11 0902 - Acme Corp - Invoice 4411. Exporting again replaces the files instead of adding copies, so you can repeat an export each month.

If some emails have no copy in the backup, the page lists them, and the export goes on without them.

The Export page for finance@contoso.com: Which emails set to Some folders with INBOX/Invoices ticked, As set to PST: one Outlook data file with the folders, To D:\Exports\Finance, and the result: Exported 2,901 of 2,904 emails, 3 of them with no copy in the backup
Export the Invoices folder of a Microsoft 365 mailbox to one PST file.

Want just a few emails? On the Search page, type a subject, sender or file name and click Search in History. The results open in the Downloads tab. Pick one email, or several with Ctrl or Shift, and choose “Export N emails…”. The Export page then offers “The 12 emails picked in the Downloads tab” (with your number) under Which emails.

Which format to choose

The Backup tab's Export page for finance@contoso.com: Some folders with INBOX/Invoices ticked, and the As list open with EML, MBOX, MSG, PST, PDF and ZIP, PST chosen
The six formats on the Export page, each with what it makes.
  • PST: one Outlook data file with the folders. For Outlook. The whole export is one Unicode PST file, with the mailbox’s folders inside it. In classic Outlook, open it with “File › Open & Export › Open Outlook Data File”.
  • MBOX: one file per folder. For Thunderbird, Apple Mail and archive tools. Thunderbird needs an import add-on, such as ImportExportTools NG, to open MBOX files.
  • EML: one file per email, as the server sent it. The standard email file. Outlook, Thunderbird and most email programs open it, and nothing is changed in it.
  • MSG: one Outlook file per email. Outlook’s own single-email format. Handy when a case file, a ticket or a document management system wants Outlook items.
  • PDF: one per email, its attachments next to it. For reading, printing and legal or audit requests. Each PDF has the email’s header and text, and its attachments are saved beside it as they are.
  • ZIP: the EML files in one zip. One file to hand over, upload or keep.

Save emails as PDF in bulk

To save a whole folder or a date span as PDFs, choose PDF: one per email, its attachments next to it, as in step 2. That’s a one-time export. To turn new emails into PDFs as they arrive, use a rule with a Convert documents step instead (PRO Rules Client). See convert emails to PDF or TIFF.

Import PST, MBOX and EML files

Old mail in a file can go into an account’s backup, where you can search it, export it or restore it.

  1. On the Backup tab, pick the account and open the Import page.
  2. Under Mail files, in What, choose PST: an Outlook data file, with its folders, MBOX: a Thunderbird or Apple Mail file, or a folder of them, or EML: a folder of .eml files (its subfolders are folders).
  3. Under From, click Browse… and choose the file or folder, for example D:\Old mail\archive-2019.pst.
  4. Click Import.

Each email keeps its folder from the file. An email already in the backup (the same Message-ID) is left out, so importing the same file again adds nothing. Imported emails are only kept in the backup: your rules don’t run on them, and nothing is uploaded to the mailbox. Each import shows up as a run under Backup runs.

The Import page for finance@contoso.com: What set to PST: an Outlook data file, with its folders, From D:\Old mail\archive-2019.pst, and the result: Imported 12,840 emails, 1,204 were already in the backup, 2 could not be read; below it, Another computer's backup
Import an old PST file into the account’s backup. Emails already there are skipped.

Convert MBOX to PST (and PST to MBOX)

There is no direct file-to-file converter. Converting is two steps: import, then export.

  1. Import the MBOX file into an account’s backup, as above.
  2. On the Export page, tick the imported folders under Some folders, and choose PST: one Outlook data file with the folders under As.

Note: the file’s Inbox goes into the account’s Inbox, so exporting that folder takes the account’s own Inbox emails too.

The same works from PST to MBOX, EML, MSG or PDF, and from a folder of EML files to PST. The emails stay in the backup afterwards. Want them in a mailbox instead of a file? The Restore page puts a backup’s emails back on the mail server, or, with Another account: in its Into box, into a different kind of account. See Restore.

Extract data: addresses and email details to CSV

Sometimes you don’t need the emails, just a list. The Extract data page writes a CSV file that Excel opens, from the same backup:

  • One row per email: received, from, to, cc, reply-to, subject, folder, attachments and size.
  • One row per email address: the people in these emails, each once: name, domain, first and last email. Tick Leave out this account’s own addresses, and no-reply ones (noreply@, mailer-daemon@…) to keep the list clean.

Click Extract now, or tick After each backup run, add the addresses of the emails it backs up. An address extracted again replaces its own row, so the file never lists it twice. Sending marketing emails to these people may need their consent. The Free edition can try it on up to 25 emails of the last day.

The Extract data page for sales@contoso.com: The whole backup, One row per email address, addresses from From, To, Cc and Reply-To, the columns Name, Seen as, First email and Last email, the CSV path D:\Marketing\sales-contacts.csv, and the result: Wrote 2,316 addresses from 18,431 emails
Extract data: one row per email address, written to a CSV file.

Good to know

  • POP3: POP3 accounts can be backed up and exported, but not restored.
  • Export and Import don’t change the mailbox.

Try it: download Mail Attachment Downloader and start with the free edition, or compare the PRO editions, each with a 30-day money-back guarantee.

Related

Questions about this post? Contact us.

Streamline your inbox: how to merge varying email attachments into a single PDF

Turn an email and its Word, Excel and picture attachments into one clean PDF automatically, without logos and signature images.

How many times have you opened an email, saved three attachments (a Word document, an Excel sheet and a JPEG picture), converted each one and then pieced them together into one file for a report or an archive?

With many emails a day, that is a lot of clicking. Mail Attachment Downloader can do it for you. With PRO Rules Server it turns an email and its attachments, whatever their format, into one merged PDF.

Here is how to set it up in version 4.0, and how to keep logos and signature pictures out of the result.

Why merge emails and attachments?

  • Simpler archives: the email’s text and its files are kept together in one document.
  • Audit and compliance: legal, finance and other teams get a complete record of each email in one file.
  • Easy sharing: send clients or colleagues one document instead of a pile of attachments.

Step 1: Save the email’s text too

For the merged PDF to start with the email itself, the rule must save the email as well as its attachments.

  1. Open the PRO Rules tab. Click New rule…, or select a rule and click Edit. The Rule Editor opens.
  2. Under Which emails, set the conditions, for example From ‘northwind.example’.
  3. Under Save, set What to save to The email and its attachments, and choose the Save folder, for example \\fileserver\Finance\Northwind.

Step 2: Leave out the junk

You don’t want social media icons or a company logo from an email signature in your clean PDF. Two settings under Save take care of that:

  • Leave out the pictures inside the text: the pictures shown inside the email’s text, such as logos and signature images, are not saved. Files attached to the email are still saved.
  • Only files of these types: tick Documents (.doc, .pdf…), and add more types in Other:, such as .xlsx, .csv. Leave Pictures (.jpg, .png, .gif…) unticked if you only want documents. If the types would hold back the email’s own .eml file, the Rule Editor says so and offers Let the email through.

Step 3: Convert everything and merge it

Version 4.0 does the converting and the merging with one choice:

  1. Click Add a step…, choose Files, then Convert all files to a single PDF, and click Add.
  2. Under What happens to the original files?, choose Delete them to keep only the merged PDF, or Keep them to keep the originals and the separate PDFs as well.
  3. Set the File name of the merged PDF, for example {SAVE_PATH}\{DATE[yyyy-MM-dd]}_{SUBJECT}_{ID}.pdf. {SAVE_PATH}\ puts it in the folder the files were saved in, and {ID} keeps each email’s PDF apart.
  4. Click Add steps, then Save.

This adds two steps under Then: Convert documents, which makes a PDF of each saved file and of the email, then Merge PDFs, which joins them. Delete them ticks Delete the originals after converting them and Delete the PDF files merged for you.

The Add a step window on the Files group: Convert documents, Merge PDFs, Convert all files to a single PDF, Split PDF, Make PDFs searchable (OCR) and more
Add a step › Files › Convert all files to a single PDF.
The Convert all files to a single PDF window: the two steps it adds, What happens to the original files? with Keep them and Delete them, the merged PDF's name {SAVE_PATH}\{DATE[yyyy-MM-dd]}_{SUBJECT}_{ID}.pdf and Put the email's text last
Convert all files to a single PDF: one window sets up both steps.

Step 4: Fine-tune the merge (optional)

Select the Merge PDFs step to change it:

  • Merge: choose All the email’s PDF files (across rules), The PDF files this rule saved so far, or Each PDF file with the email converted to PDF (one PDF per attachment, each with the email in front).
  • Put the email’s text last moves the email to the end.
  • File name: click Fields… to build the name from the sender, the date, the subject or any field.

In the Convert documents step, tick Ignore failures (when several types are converted) so that one file that can’t be converted doesn’t stop the rest.

The Merge PDFs step in the Rule Editor: Merge set to All the email's PDF files, a file name in the save folder with the date, subject and ID, and Delete the PDF files merged
The Merge PDFs step: what is merged and what the merged file is called.

The result

Once the rule runs, the program does the rest. When an email matches, it leaves out the junk, converts the files, and builds the document. Run it on a schedule, as new email arrives, or as a Windows service with nobody signed in.

Your folder gets one PDF for each email. The first pages show the email, and the attachments follow, rendered as PDF pages.

Before you turn it on, click Test this rule… on the PRO Rules tab to try it on a few emails. Nothing is changed.

Merge several emails into one PDF

Leave {ID} out and give the merged PDF a name that several emails share, and their pages go into the same file, one email after the other. For example, {SAVE_PATH}\{PROCESSED_DATE_LOCAL[yyyy-MM-dd]}_Northwind.pdf gives one PDF for the day’s Northwind emails.

This works within one download. A merged PDF left by an earlier download is replaced, not added to, so the same emails always give the same PDF. If the rule runs more than once a day, put the hour in the name too, such as [yyyy-MM-dd_HH], and choose Keep them so the separate files stay as well.

Going beyond PDF

  • Password: tick Encrypt the PDF in a conversion to protect sensitive files.
  • Other formats: PRO Rules Server converts to more than 50 formats, including multi-page TIFF, HTML and JPEG. See Convert emails to PDF or TIFF.
  • Scans: Make PDFs searchable (OCR) and Split PDF handle scanned batches.
  • Old mail: with PRO Backup, the Backup tab exports kept emails to PDF without a rule. See Export.

Try it: download Mail Attachment Downloader and start with the free edition, or compare the PRO editions, each with a 30-day money-back guarantee.

Related

Using version 3.x? See the 3.x version of this guide.

Contact us with any questions or suggestions about this post.

Email actions: unzip an attachment, convert to PDF, decrypt a PDF and run a script

Unzip email attachments, convert or decrypt each file as PDF, then run a script on the result: steps inside steps in Mail Attachment Downloader.

This post shows how to set up a rule that unzips an email attachment, converts each file inside to PDF (or removes a PDF’s password), and then runs a script on the result. It is written for version 4.0.

Which edition you need:

You start from a rule with its conditions and its Save part set up, for example for the emails from acme.example, saved to \\fileserver\Finance\Invoices. New to rules? See save emails and attachments to folders.

Steps work on the saved files. To run them on the email itself too, set What to save to The email and its attachments: the email is then saved as an .eml file, and Convert documents can turn it into a PDF.

1. Unzip the attachment

In the Rule Editor, click Add a step…, find Unzip (type “zip” in the search box) and click Add. It goes under Then. Its options:

  • Only these files: one file name or extension per line, such as .docx and .pdf. Leave it empty to unzip every file.
  • Delete the zip file after unzipping it, if you only want the files inside.
  • Keep the folders inside the zip, to keep the zip’s own folders.
The Rule Editor with an Unzip step under Then, and its options: Delete the zip file after unzipping it, Only these files and Keep the folders inside the zip
The Unzip step and its options.

2. Convert each unzipped file, inside Unzip

Steps inside the Unzip step run for each file it unzips. To add one there:

  1. Select Unzip in the rule’s outline.
  2. Click Add a step… and, in the Add it: box, choose Inside “Unzip”.
  3. Pick Convert documents and click Add.

In the Convert documents step, click Add… to add a conversion. In the Conversion window, choose what is converted in From:, choose pdf in To:, and set the result’s name in Save as:, such as {SAVE_PATH}\{FILENAME}.pdf. Add one conversion for each kind of file, for example Word files and pictures. Tick Delete the originals after converting them if you only want the PDFs.

The Conversion window: From, To pdf, Save as with fields, Run the rules on the result, Convert with Free libraries, and the options for pictures and for the PDF made
The Conversion window of the Convert documents step.

Decrypt a PDF

Do the files arrive as password-protected PDFs? Add a conversion from PDF to pdf, with a new name in Save as: such as {SAVE_PATH}\{FILENAME}_open.pdf. Under A PDF converted, type the password in Decryption password:. The PDF it saves has no password. Remove the restrictions also drops limits such as no printing or no copying. It works the other way too: Encrypt the PDF, under The PDF made, adds a password to the PDFs you make.

The Conversion window: from PDF to pdf, saved as the file name with _open, and under A PDF converted a masked Decryption password
A PDF converted: the password opens a protected PDF, and the copy is saved without it.

3. Run a script on the converted file, inside Convert documents

Now select Convert documents, click Add a step…, choose Inside “Convert documents” in the Add it: box, and pick a step from Programs:

  • Run a script runs a script with the fields and waits for it to finish. Set the Program: (a .bat or .exe file, or powershell.exe for a PowerShell script), its Arguments: and a Timeout (seconds):. What it prints goes to the program’s logs.
  • Run a command line runs a program or a .bat file with the fields: set the Command: and its Arguments:.

Click Fields… to add fields to the arguments. Inside Convert documents, {SAVE_PATH} and {FILENAMEEXT} are the converted PDF, not the zip or the file it was made from. For example, with powershell.exe as the program, the arguments could be -File "C:\Scripts\ArchiveInvoice.ps1" "{SAVE_PATH}\{FILENAMEEXT}" "{EMAIL_FROM}".

Run: says whether the step runs For each saved file or Once per email. Click Run it once (test) to try it with a sample email’s values.

The Run a command line step: Command C:\Tools\ArchiveInvoice.exe, Arguments with the SUPPLIER, SAVE_PATH and FILENAMEEXT fields, Run For each saved file, and Run it once (test)
A Run a command line step, with fields in its arguments.

The finished rule

The rule’s outline now reads:

  • Then
    • Unzip
      • Convert documents
        • Run a script

Each zip is unzipped, each file inside is converted to PDF, and the script runs once for each PDF.

The Rule Editor of the rule Acme invoice zips: under Then, Unzip, with Convert documents inside it and Run a script inside that, running powershell.exe with -File and the saved file
Steps inside steps: Unzip, then Convert documents on each file, then Run a script on each PDF.

Click Test this rule… to try it on emails you pick. Unzipping and converting are done for real, into a temporary folder, so you can open the PDFs. The script is only described, not run. Then click Save.

A step can fail, for example when a PDF’s password is wrong. Steps under If something fails, such as Move or copy the email or Send notification, tell you or set the email aside. The program also tries a failed step again by itself. See nesting email rules and actions.

More steps for files

Other steps go well with these: Convert all files to a single PDF, Merge PDFs, Split PDF and Make PDFs searchable (OCR) (PRO Rules Server), and Upload to cloud or Copy file (PRO Rules Client and up). Need a step that isn’t there? Contact us and we’ll look at it.

Try it: download Mail Attachment Downloader and start with the free edition, or compare the PRO editions, each with a 30-day money-back guarantee.

Related

PDF to DOCX conversion and more, straight from your email

Email a PDF to a mailbox and get a Word (.docx) file in your folder: convert PDF attachments to DOCX, TIFF, pictures and more automatically.

Need a PDF as a Word file? Email it as an attachment to a mailbox of your choice. Mail Attachment Downloader picks it up, converts it to DOCX and saves it in the folder you want.

Converting to formats other than PDF needs PRO Rules Server. It can also run as a Windows service, 24×7, with nobody signed in, on a PC, a server or a cloud VM. So the conversion happens even when your own computer is off. This post is written for version 4.0.

Set up PDF to DOCX

  1. Open the PRO Rules tab. Click New rule…, or select a rule and click Edit. Give a new rule a name you’ll recognize, such as “PDF to Word”.
  2. Under Which emails, add the conditions, for example To ‘convert@contoso.com’ and Attachment name ‘.pdf’. Under Save, set the Save folder, for example \\fileserver\Finance\Converted.
  3. Click Add a step…, choose Files, then Convert documents, and click Add.
  4. In the step, click Add…. In the Conversion window, set From: to Any pdf (pdf, latex etc.) and To: to docx.
  5. In Save as:, set the new file’s name, for example {SAVE_PATH}\{FILENAME}.docx. Click OK.
  6. Click Save. That’s it!

From now on, each PDF attachment that matches the rule is saved and converted to DOCX. Tick Delete the originals after converting them in the step if you want only the Word files.

The Conversion window with From set to Any pdf (pdf, latex etc.), the To and Save as boxes, and options for pictures and PDFs
The Conversion window. Set From to PDFs, and To to docx.
The Conversion window: from Any pdf to docx, saved as {SAVE_PATH}\{FILENAME}.docx, with Default as the engine, and under A PDF converted a masked Decryption password, Remove the certificate and Remove the restrictions
PDF to DOCX, with the options for protected PDFs.

Password-protected PDFs

A PDF with a password has to be opened before it can be converted. In the Conversion window, under A PDF converted, type the Decryption password:. You can also tick Remove the restrictions or Remove the certificate.

Only need some of the pages? Type them in Pages to convert:, for example 1-3, 7. Empty converts every page.

More than DOCX

The same step converts PDFs to other formats too, such as DOC, Excel, PowerPoint, HTML, XPS, text, multi-page TIFF, PNG and JPEG. Just pick another To:. For pictures, set the Resolution (dpi): and TIFF compression: under Pictures (to JPEG, PNG or TIFF).

It works the other way round as well. With PRO Rules Server, emails (.eml, .msg, .txt, .html) and attachments (Word, Excel, PowerPoint, pictures and more) convert to 59 formats:

  • DOCX to PDF, PNG, JPEG, HTML and more
  • PDF to DOCX, PNG, JPEG, HTML and more
  • CSV, XLSX to PDF, PNG, JPEG, HTML and more
  • PPTX to PDF, PNG, JPEG, HTML and more
  • EML to PDF, DOCX, PNG, JPEG, HTML and more
  • JPEG, BMP, TIFF and other pictures to PDF, DOCX, HTML and more

Converting to PDF only? That needs just PRO Rules Client. See Convert emails to PDF or TIFF.

Keep it running

To convert around the clock, install the program as a Windows service on Schedule › Service schedule. The service uses the settings it got when it was installed, so reinstall it there after you change a rule. See Run as a Windows service.

The Downloads tab shows each email the rule took, and whether the conversion worked. Each email is handled once: the program remembers it in its History, so nothing is converted twice.

Try it: download Mail Attachment Downloader and start with the free edition, or compare the PRO editions, each with a 30-day money-back guarantee.

Related

Using version 3.x? See the 3.x version of this guide.

Questions or suggestions? Contact us.

Convert emails to PDF or TIFF, including email attachments

Save emails and their attachments as PDF, TIFF or 50+ other formats automatically, one file each or merged into one PDF, with Mail Attachment Downloader.

Mail Attachment Downloader can save your emails and their attachments as PDF files. With PRO Rules Server it can also make multi-page TIFF files, Word files, pictures and more than 50 other formats.

All of it is one step in a rule: Convert documents. This post shows how to set it up in version 4.0.

Which edition converts to what

  • PRO Rules Client converts emails and attachments to PDF, and can protect the PDF with a password.
  • PRO Rules Server also converts to TIFF, DOCX, PNG, JPEG, HTML and the other formats. It also merges an email and its attachments into one PDF.

If your edition can’t make the format you pick, the conversion window says so: “Only PRO Server converts to other types than PDF.” See plans and prices.

Convert attachments to PDF or TIFF

  1. Open the PRO Rules tab. Click New rule…, or select a rule and click Edit. The Rule Editor opens.
  2. Under Which emails, set the conditions, for example From ‘acme.example’. Under Save, choose What to save and the Save folder, for example \\fileserver\Finance\Invoices.
  3. Click Add a step…, choose Files, then Convert documents, and click Add. The step goes under Then.
  4. In the step, click Add…. The Conversion window opens.
  5. In From:, choose the kind of file to convert, for example Any doc (doc, docx, txt, html etc.). Other kinds cover PDFs, spreadsheets, slides, pictures and emails, and All possible takes every kind (to PDF only).
  6. In To:, choose pdf or, with PRO Rules Server, tiff or another format.
  7. In Save as:, set the converted file’s name. Click Fields… to insert fields, for example {SAVE_PATH}\{FILENAME}.pdf.
  8. Click OK. Add one conversion for each kind of file you get: Word files, Excel sheets, slides, pictures.
  9. Tick Delete the originals after converting them if you want only the converted files in the folder.
  10. Click Save.
The Rule Editor with a Convert documents step under Then, with Add, Edit and Remove buttons for its conversions and the Delete the originals after converting them option
A Convert documents step. Each conversion in it handles one kind of file.
The Conversion window: From, To, Save as, picture options with TIFF compression, and the PDF options Fit to page, No margins and Encrypt the PDF
The Conversion window: what is converted, what it becomes, and the options for pictures and PDFs.

Each attachment of a matching email is now saved, then converted. Want to see it first? Click Test this rule… on the PRO Rules tab. It runs the rule on emails you pick and shows what it would save. Nothing is changed.

Converting several kinds in one step? Tick Ignore failures (when several types are converted), so one file that can’t be converted doesn’t stop the others.

Save the email itself as PDF or TIFF

The email’s own text can be converted too. In Save, set What to save to The email and its attachments, or The email only. The email is saved as an .eml file, which counts as a document for conversion.

Then add a conversion from Any email (.eml, .msg etc.) to pdf or tiff. The Conversion window has options for emails:

  • Skip the email’s header (emails), to leave out its header.
  • Skip the attachments it can show inside (emails), when you convert the attachments separately.
  • The email’s date in this computer’s time zone (emails).

TIFF and picture options

When To: is a picture format, the Pictures (to JPEG, PNG or TIFF) options apply: Resolution (dpi):, Quality: and TIFF compression:. A document with several pages becomes one multi-page TIFF file.

Protect the PDF with a password

Under The PDF made, tick Encrypt the PDF. Choose the Algorithm: and type an Owner password: and a User password:.

One PDF for each email

The steps above make a separate PDF for each attachment. To get one PDF per email, with the email first and its attachments after it, use Convert all files to a single PDF (PRO Rules Server). It adds a Convert documents step and a Merge PDFs step in one go. See merge email attachments into a single PDF.

More than 50 formats

With PRO Rules Server, emails (.eml, .msg, .txt, .html) and attachments (Word, Excel, PowerPoint, pictures and more) convert to 59 formats. The popular ones:

  • DOCX to PDF, multi-page TIFF, PNG, JPEG, HTML and more
  • PDF to DOCX, multi-page TIFF, PNG, JPEG, HTML and more
  • CSV, XLSX to PDF, multi-page TIFF, PNG, JPEG, HTML and more
  • PPTX to PDF, multi-page TIFF, PNG, JPEG, HTML and more
  • EML to PDF, multi-page TIFF, DOCX, PNG, JPEG, HTML and more
  • JPEG, BMP, TIFF and other pictures to PDF, DOCX, HTML and more

The whole list is on the features page. For PDF to Word, see PDF to DOCX conversion and more.

More in 4.0

  • Steps after the conversion: tick Run the rules on the result in a conversion, or put steps after it, to upload, merge or send the converted file. See steps under steps.
  • Scanned PDFs: Make PDFs searchable (OCR) adds a text layer (PRO Rules Server). See OCR.
  • A PDF archive of old mail: with PRO Backup, the Backup tab can export the emails it keeps to PDF, with no rule at all. See Export.

Try it: download Mail Attachment Downloader and start with the free edition, or compare the PRO editions, each with a 30-day money-back guarantee.

Related

Using version 3.x? See the 3.x version of this guide.

Contact us with any questions or suggestions about this post.