Colour missing from PDF generated from Print Format sent by email

Hi All, Team,

I’ve set up a print format as shown in screenshot 1 below.

The demand notice number on the sales invoice is supposed to be in red and indeed it appears so in the print preview as well as the pdf view (see screenshots 2 & 3)

However, when I get it in email, the formatting is lost and the demand notice number does not appear in red. (see screenshot 4)

Would be glad for any help.

Screenshot 1 - Print Format

Screenshot 2 - Print Preview

Screenshot 3 - PDF Preview

Screenshot 4 - PDF sent through mail

Regards,
cksgb

Hi, could you try
<b style="color:red !important;">

1 Like

@Chude_Osiegbu this is a problem I have been having in ALL forms when printing and emailing for a while now!

I have not been able to resolve this still, so very interested if you have any ideas. I have tried a number of things including tags like !important to no avail. In the end I just assumed the CSS server side is over-riding my settings and there’s not much I can do being on the cloud - would be very happy to be proven wrong and fix this though :slight_smile:

Hi @switsoIAG,

Unfortunately, using the important! tag didn’t work.

Regards,
cksgb

Just tested with tag !important, worked for me on PDF and other formats.

1 Like

Hi @KanchanChauhan, it works for me too on the client side but when the same pdf is sent as an attachment in email by ERPNext to a contact, the colour is lost.

Regards,
cksgb

Any solution for this?

Hi,

You can apply font-color as well as background color using bellow CSS:

In this css it is applying background color, border, alignment.

td.print-format {
background-color: grey !important;
text-align: left !important;
vertical-align: middle !important;
width: 25px !important;
height: 20px !important;
font-size: 14px;
}

You can use this CSS as class in your tag:

class=“print-format”

This worked for me while export it to PDF and/or Print.