4

When adding all of the address fields in a PDF letter i am getting a blank line for supplemental address line 1 if that user does not have that field populated. Is there any way to avoid having a blank line? i am doing a large mail merge using this and it does not look professional to have a blank line in the address block. Here is how i have the tokens setup.

{contact.display_name} {contact.current_employer} {contact.street_address} {contact.supplemental_address_1} {contact.city}, {contact.state_province} {contact.postal_code}

4

The issue isn't 100% clear because your formatting doesn't allow me to perfectly understand which tokens have a line break after them and which have a space - but I'm pretty sure I know what's going on. By default, if a token evaluates to NULL and there is NOTHING else on that line, the line will be omitted entirely when producing address labels.

However, from your token listing, it seems that you have a space after {contact.supplemental_address_1}. That's going to cause a space on the line, even if there's no supplemental address value.

If for formatting reasons you need a space there if there IS a supplemental address, there's a trick. Let's look at the default mailing address format:

{contact.addressee}
{contact.current_employer}
{contact.street_address}
{contact.supplemental_address_1}
{contact.supplemental_address_2}
{contact.city}{, }{contact.state_province}{ }{contact.postal_code}

Note the {, } after the city and the { } after the state/province. It's not well-documented, but that means, "include a ', ' after the city if a city exists" and "include a space after the state/province if a state/province exists".

  • I have this same issue. Mailing labels work as described. However, Printing pdf letters using the same contact address includes a blank line for a null field - e.g. supplemental address. – Dave T Mar 12 '16 at 13:03
  • Same for me, a lot of my contacts have a blank supplemental address field, I use this token in a document and it results in a blank line, even if the token is the only thing on its line. – Flo Oct 5 '16 at 12:44
  • 2
    I found a client with the same problem in PDFs. In their case they had used <BR> rather than <p> tags to end the lines! – petednz - fuzion Jun 20 '17 at 7:05
2

Check your template html and ensure you are using <p> not <BR> tags to end the lines

0

I'm a bit confused by some of the comments above which refer to labels which seem to be a different mechanism. I think that my answer to Removing Carriage returns after a blank address field? solves the problem.

I found removing the space before BR markup didn't solve the problem and that using P markup instead of BR markup mean the lines were spaced too far apart

I also appreciate the problem of formatting answers particularly when there is markup in it. I could not make this look right!

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.