PlanetPress for Work: One Mailing

One of the most useful and easy-to-achieve applications in PlanetPress is the ability to combine two or more types of document in a single mailing.

The problem

Many customers I have helped in the past have a common problem: they produce invoice documents which are mailed out at one time during the month and also statement documents, often mailed at a different time to the same customers. It could just as easily be a letter and an invoice or statement and even all three! This means that two or three postage and handlings are required which is expensive and wasteful.

Another issue is that within a large batch of invoices (other document types apply) there may be several invoices for the same customer. Unless the invoices for each customer are combined, this will mean that the customer receives several mailings, each with a different invoice!

Often customers are unable to sort or combine these different mailings because they are produced at different times and possibly even from different systems that generate data in diverse formats for the two document types.

PlanetPress is the perfect solution to these challenges and I have implemented this solution several times in different situations. The key is PlanetPress PDF workflow!

All that is required for this to work is that there is at least one piece of information that identifies each customer somewhere on each document. This is most usually a customer number or other reference unique to each customer. This reference can be in any position on each document type as long as it is consistent for each.

How it works

The really easy way is to create PDF versions of each document type and place each type in a different folder – say we call these C:\invoices and C:\statements. So far, so good. We now have an invoice file containing many invoices. Each invoice can be a different number of pages. It’s possible that within the invoice file there are several invoices for the same customer. We also have a statements file again containing statements with a varying number of pages for each customer.

In a workflow process we first read the invoice documents (or whichever document has the address panel we want to use for mailing) from a folder capture C:\invoices. We do this on a right-hand branch so that we can control the sequence of operations. We then split the documents using the PDF splitter plug-in into a separate document for each customer. We can define the split to occur when the invoice number changes – or whatever works with the particular document.


Now comes the clever bit: we save each document in a temporary folder using the unique reference as the file name and tick the “Concatenate” box.

In the send to folder options above, the file name is an area of our PDF containing the unique reference. It is important to trim the leading and training spaces (tick the Trim box when making the area selection) and add “.pdf” to the end. The file will be saved as something like 123ABC.pdf

The concatenate box is one of the most powerful yet simple features of PlanetPress workflow. Normally, if we save a file to a folder and a file of the same name already exists, that file will be overwritten with the new version. By concatenating (joining) the files, we literally add one file onto the end of the previous one. For PDF files you can ignore the Separator string box.

At the end of the split, we have a temp folder containing all the invoices named by the unique reference. Because we are concatenating, if there were several invoices for the same customer, these will all be combined into one PDF file for that customer.

Although that in itself is a great advantage, we can now go even further.


We start another process right-branch and here repeat the process but with the second document type such as statements. The folder capture will be from C:\statements (or whatever folder you used). Again a PDF splitter splits the documents into individual PDFs and we save them using an area selection for the unique reference. This will be in a different place on the document but as long as it’s the same as the invoice, then this works fine.

The key thing is that we save them to the same folder we saved the invoices to. This means that when a statement file has the same name as an existing invoice file, the two files are joined together!

In the temp folder we now have a file for each customer named by unique reference.pdf. These files will contain all the invoices and all the statements for that Customer.

A final branch can merge all the files from the temp folder into a single large file for printing.

Invoices and statements are then printed together for each customer and can be enveloped and mailed as one document.

This effectively at least halves the number of postal items, saving postage and handling. The savings can be considerable and contribute to a fast ROI. It also presents a more professional image to the customers.


Although invoices and statements are the most obvious application of this technique, any situation where different document are mailed to the same customers can benefit from this consolidation.

A note for the more technical: If the unique reference is not exactly the same in each document type (one may have a – and another a / for example), you can extract it to a local variable and use a simple script to re-format it so they are all the same. Write the new string to a local variable and use that when saving the files. Of course some characters are illegal to use in file names so these will need to be removed or changed.