Saturday, January 27, 2018

Acrobat -- Mail Merge and Email PDF Files

Direct purchase using PayPal ($99 per license)!
Another new and powerful tool to make your PDF experience easier and more efficient.
This time, it's a PDF mail-merging tool. "Mail merging" is the production of multiple (and potentially large numbers of) documents from a single template form and a structured data source (Wikipedia). In this case the template is a PDF file with form fields and a plain-text or CSV file (which can be easily exported from an Excel spreadsheet).
The tool even offers the option to automatically email the merged files to the recipients (see below)!

A free DEMO version of this tool which will process up to 3 items in a list, but does not contain the auto-email feature. You can download and try it from here.

Update (27/01/2018): Due to a bug in some versions of Acrobat that prevented merging more than 50 files at a time I have removed the Flattening Pages option from the tool and reverted it back to a previous version that was not affected by this issue.
Instead of the "Flatten Merged Files" option I added an Action that allows doing it after the files have been merged, so the functionality of the tool is the same.

Update (01/11/2017): Another new feature, based on popular demand.
It's now possible to encrypt the merged files, either using the same policy for all of them, or by specifying a policy for each individual file (this has to be done manually, though).
In addition, I've moved the option to flatten the merged files from the email dialog to the main one, which means that you can do it even if you don't wish to email them.
The new application dialog looks like this now:

The new features are highlighted in red

When the option to encrypt the files is selected, this dialog appears:

Here you can select your own security policy (like the last one in the screenshot) to apply the same policy to all files, or one of the built-in policies (the first two) and specify the specific settings you wish to use for each file.

Update (29/08/2017): Yet another new feature added to this tool. It's now possible to flatten the copies of the merged files before they are sent out, so the users will receive a non-editable copy.
The new Email Settings dialog now looks like this:

Update (28/01/2015): A new feature and a new look for this tool! The Price is the same...

The new feature is the ability to merge all the records as a single PDF file. This means you can then easily print them out and send out by regular mail, for example.

The new look of the tool is more concise and easy to use. There are still two buttons, but they are now called: "Mail Merge" and "Mail Merge (To Single File)".

The new buttons (click to enlarge)

After clicking on the first one, for example, you're presented with this dialog window, where various settings can be set:

Clicking the second button causes this smaller window to appear:

Then you're prompted to select the input file and if you selected the option to email the generated files then the email settings window (see below) appears as well.

The files are then generated and saved. In the "single file" a file called merged.pdf is generated and saved in the same folder as the original PDF file.

Update (04/12/2014): A new feature added to this tool. You can now include not just text but also IMAGES in your merged files. Simply create a button field in your PDF and set its layout to "Icon Only" and then specify the file-path to the image in the input spreadsheet, and voila! The image is automatically imported into your file along with the other data.

How the tool works?
You start by setting up your input file and the empty PDF form (notice the column headers match the field names in the PDF):

If you have any questions regarding this tool, you can contact me directly.
(Click on "Read More" to see the rest of the post)

The merged files are then created and saved in the same folder as the original:

You can see that each file now contains the data from the input file:

If you have chosen the option to automatically email the files, you will be presented with this dialog:

After entering the different settings, a customized email will be created for each recipient, with the filled-in form as an attachment:

When the tool finishes running, an message is displayed:

You can download the sample PDF files and list shown above from here.

If you have any questions regarding this tool, you can contact me directly.


Unknown said...

This may be what I am looking for. But once I create the template. I need to apply the datasource and mail merge from the sdk. Is this possible?

Gilad D. (try67) said...


I'm not sure what you mean... Could you please contact me privately so we can discuss it in detail?

drjjw said...

1. Will this work on Acrobat Pro DC for Mac?

2. Will I be able to use input data from an excel file to fill multiple PDFs for each row of data? I don’t want to merge in to a single PDF file.

3. Is there a trial version I can experiment with?

Gilad D. (try67) said...

1. Yes
2. Yes, of course. The script will generate multiple copies of the PDF, one for each row in the spreadsheet.
3. Yes, a demo version, with limited capabilities:

Samantha Perez said...

Will this work on Bluebeam?

Gilad D. (try67) said...

Maybe, I haven't tested it... I can only guarantee it will work in Adobe Acrobat.
If you're interested, though, I have developed a stand-alone version of this tool. You can contact me by email to discuss it privately.

Danny Zitting said...

1. Can I have additional data in the spreadsheet (i.e. other columns) which I do not want to merge into the PDF?
2. Also, can I have additional form fields in the PDF which I do not want to be populated from the Excel?
3. Are both the above accomplished by simply having PDF form field and Excel column names which do not match? That is, will the script simply skip over any form fields/columns that do not have matching names and go on to the next?
4. Can I populate the form with hyperlinks from the excel sheet which are clickable in the PDF? (text link or preferably a button/icon image)

Gilad D. (try67) said...

@Danny Zitting
1. Yes
2. Yes
3. Exactly, yes
4. Not sure how that would work... You can populate a text field with a URL, but you will need to add the script that opens that URL in the browser yourself. I can help you set it up, but the script won't do it for you. You can import an image to a button field, though.


Michael Brown said...

A question.

1. In the demo I noticed that the completed PDF still had editable fields. We need the fields locked. Is this possible?

Gilad D. (try67) said...

@Michael Brown
This option is only available in the full version, not in the demo.

Ignacio Alejandro Pérez Gallegos said...

I'm having some trouble when the elements in the excel sheet have special characters or accents, such as ñ, ¨ or ´. In this cases the special characters or accents aren't shown in the final result. Is ther any way to solve this?

Gilad D. (try67) said...

When saving the Excel file as a text file, make sure it is encoded in UTF-8.
If you need further help with this issue please email me.

David G said...

I see that the document can be flattened so that fields aren't editable, but can security settings also be applied?

Gilad D. (try67) said...

@David G
That might be possible, yes. Contact me privately to discuss it further, please.

David G said...

I have to say that this is absolutely the real deal - I will definitely look up Gilad again if I need something else done.

Yesterday I started with a question and today I have a customized script that is working exactly the way I want. No B.S. This is awesome.

There was great communication and he worked quickly to tweak the customization the way I needed it.


Gilad D. (try67) said...

Thanks a lot, David, and glad to hear it's working well for you!


Ignacio Alejandro Pérez Gallegos said...

This script is excellent. I have only one doubt. Is there any way to prevent pdf files from opening automatically when they are created? There's a limit to the number of pdf files that can be opened at the same time, so it's been difficult for me to use the script massively (because the script stops working when 50 files have been created)

Gilad D. (try67) said...

@Ignacio Alejandro Pérez Gallegos
This is a bug in some versions of Acrobat, where the script is unable to close open files, and then it indeed gets stuck after 50 files. However, I took some measures to try and mitigate this issue. If you're still having this issue please contact me privately and I'll do my best to help you solve it.

Anthony Leem said...

Hi, I purchased this and have been successful at generating multiple pdfs from my excel data sheet. However, Adobe fails to send any emails. I tried seeing if Adobe had emailing enabled - and it does, if I have a single pdf open, I can email it from within Adobe, and it just opens up a new apple mail message with the pdf already attached. So it must be an issue with the script and I would like some help please. Thank you!


Gilad D. (try67) said...

@Anthony Leem
Please send me an email and I will help you solve this issue.