Printing to PDF where destination is variable

Figured I would share this conversation from another forum, as I find this invaluable, as I have my clients all set up with a separate directory,a and subdirectors to mimic an old fashioned file cabinet with working paper, tax, correspondence, etc. files:

"I can see what you are doing here. It looks like we need to do two things to make this work auto-magically for you:

  1. Give the PDF printer the capability to create directories (and stop stripping the backslashes () from the file name)
  2. Provide some way to get the first letter of the last name as a variable, perhaps with some extra trickery to support M, Mc, Mac.

So once I’ve done this, you would set your “Email/Save as” to as follows:


And you would set the PDF file name to:

{LastNameLetter}{Name}{ReturnYear}{Return Year} {ReturnType} {name}.pdf
Which would translate to

H:\1Scans\T1\A\Apple, Nadine\2014\2014 T1 Apple, Nadine.pdf

I’m not sure what you are suggesting by adding a {ReturnYearDirectory} variable… at this point we are just evaluating it as text so I don’t think we need to create a new variable. {ReturnYear} will translate to 2014 regardless of where you use it in the file name “formula”.

Please confirm that I understand correctly.

I’ll investigate and report back in a day or so.

~ Cameron"

"I think I’ve got this working now. I’ll have someone test it on Monday so it should be in the release next week.

The only visible change that you’ll see is that there is a new file naming variable called {FilingCabinet} which returns the first letter of the last name, or in the case of McDonald or MacDonald, “Mc” and “Mac” respectively. There may be other letter groupings we’ll need to handle automatically as well.

And, it will no longer strip out the \ from the filename.

As long as you use only the variables and no hard coded years, the file naming should work each year going forward.

Thanks for the ideas!

~ Cameron"

1 Like

Works like a charm for me.

Just reset all my PDF printsets on the T2 module, and it is now automating the PDF distribution among the various files.

1 Like

That is more than a little kool.

Will save a massive number of hours

1 Like

Now need the ability yet to save a carryforward file to the same location as the last year file…:slight_smile:

Thought I had hit a home run, but…

Instead of naming putting the file in

\filing personal\Adams, Norm\2014 Adams, Norm.pdf

it is putting it in

\filing personal\Norm Adams\2014 Adams, Norm.pdf

Any idea why it is reversing first and last name? The file name itself stays last name, first name…


I just looked at this and the {Name} variable returns “Bert Mulder”. To do it the other way, use
{LastName}, {FirstName} in place of {Name}

That should do the trick. If need be we can add another variable that provides the name in that LastName, FirstName format.

~ Cameron

1 Like


Sorry Cameron, but that ({LastName}, {FirstName}) is not going to work, as it gives me then a folder for the taxpayer, and another folder for the spouse…

What we need is a variable which gives us:

Lastname, first name & spouse first name.

Or else, simply a variable which draws from where the main file is kept…

Okay… {Name} would have given you two folders one for the spouse and one for the principal as well. Let me ponder how to best solve this.

~ Cameron

1 Like