I have a requirment to create a custom document where the font colors change depending on the value of the field. My first thought was Conga but working with the if statement is Word is a pain. I thought it would be easier to write a visualforce page that renders as a PDF.
Below is the basic code. The color rendering works fine as a web page but as soon as I add renderAs="PDF" I loose the font colors. Is there a way to make this work?
<apex:page id="Region_Health_Check" showHeader="false" standardController="Region__c" docType="html-5.0"
sideBar="false" standardStylesheets="false" applyBodyTag="false" applyHtmlTag="false" renderAs="pdf">
<head>
<title>Region Health Check Report</title>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<apex:stylesheet value="{!$Resource.HealthCheckStyle}"/>
</head>
<table width="100%">
<tr width="100%">
<td width="50%" align="left">Email Engagement Score Card</td>
<td width="50%" align="right">Overall Health Check Score</td>
</tr>
<tr width ="100%">
<td width="50%">
<span style="font-family: BrownStd; font-size: 24px">
<apex:outputText value="{!Region__c.Name}"/>
</span>
</td>
<td width="50%" align="center">
<font color="{!if(Region__c.Grade__c='A', 'green', 'blue')}">
<apex:outputText value="{!Region__c.Grade__c}" style="font-size: 39px; font-family: BrownStd, SansSerif"/>
</font>
</td>
</tr>
</table>
</apex:page>