<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: How to highlight specific text with color at ODS PDF output? in ODS and Base Reporting</title>
    <link>https://communities.sas.com/t5/ODS-and-Base-Reporting/How-to-highlight-specific-text-with-color-at-ODS-PDF-output/m-p/748005#M25073</link>
    <description>Hi:&lt;BR /&gt;  Yes, &lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/37107"&gt;@jimbarbour&lt;/a&gt;'s choice b is the answer. I always explain it to my students this way when they ask if something is possible (like can I change the page number to the bottom of the page) -- The answer is "It depends on the destination" -- RTF and PDF -- yes; HTML -- No, ODS Excel, yes, but you have to use Microsoft specific field codes to do it.&lt;BR /&gt;&lt;BR /&gt;  The way I understand PDF is that PDF "wants" the background color to apply to the entire data cell. So foreground color for part of the string is OK. But background color doesn't work for inline formatting because PDF wants the whole cell to have the same background. It's different for RTF and Word because, well, Microsoft.&lt;BR /&gt;&lt;BR /&gt;Cynthia</description>
    <pubDate>Tue, 15 Jun 2021 01:15:00 GMT</pubDate>
    <dc:creator>Cynthia_sas</dc:creator>
    <dc:date>2021-06-15T01:15:00Z</dc:date>
    <item>
      <title>How to highlight specific text with color at ODS PDF output?</title>
      <link>https://communities.sas.com/t5/ODS-and-Base-Reporting/How-to-highlight-specific-text-with-color-at-ODS-PDF-output/m-p/747882#M25061</link>
      <description>&lt;P&gt;Hi, I wonder how to change the background color of a text string via ODS PDF. It works at ODS RTF, but I don't know why it does not work at ODS PDF. Here is the code:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data aaa;
a=cat('abc',"^{style[backgroundcolor=pink foreground=red]defg}","hi");
output;
a=cat('abc',"^{style[background=pink foreground=red]defg}","hi");
output;
run;

ods escapechar='^';
ods pdf file="test.pdf";&lt;BR /&gt;ods rtf file="test.pdf";
proc print data=aaa;
run;
ods _all_ close;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;The ODS RTF output returns this, and that is what I want: red text with pink background.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="abcg_0-1623690328098.png" style="width: 400px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/60367i296B95FFBF4BF372/image-size/medium?v=v2&amp;amp;px=400" role="button" title="abcg_0-1623690328098.png" alt="abcg_0-1623690328098.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;But ODS PDF output returns just red text, background color does not change.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="abcg_1-1623690355431.png" style="width: 400px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/60368i957E26A7EE41F8E6/image-size/medium?v=v2&amp;amp;px=400" role="button" title="abcg_1-1623690355431.png" alt="abcg_1-1623690355431.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Can anyone show me any issue from my code? Thanks!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 14 Jun 2021 17:14:20 GMT</pubDate>
      <guid>https://communities.sas.com/t5/ODS-and-Base-Reporting/How-to-highlight-specific-text-with-color-at-ODS-PDF-output/m-p/747882#M25061</guid>
      <dc:creator>abcg</dc:creator>
      <dc:date>2021-06-14T17:14:20Z</dc:date>
    </item>
    <item>
      <title>Re: How to highlight specific text with color at ODS PDF output?</title>
      <link>https://communities.sas.com/t5/ODS-and-Base-Reporting/How-to-highlight-specific-text-with-color-at-ODS-PDF-output/m-p/747966#M25069</link>
      <description>&lt;P&gt;I ran your code and got the same results.&amp;nbsp; I used two different means to open the pdf, so I don't think it's your pdf reader that is at issue.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The fact that the code works for one ODS destination but not another suggests that one of the following may be true&lt;/P&gt;
&lt;P&gt;a) there could be a bug in the SAS software&lt;/P&gt;
&lt;P&gt;b) this feature just isn't supported in pdf&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I don't really know which it is in this case.&amp;nbsp;&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/13549"&gt;@Cynthia_sas&lt;/a&gt;&amp;nbsp;seems to know a lot on this subject.&amp;nbsp; Perhaps if she has time she can weigh in.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Jim&lt;/P&gt;</description>
      <pubDate>Mon, 14 Jun 2021 21:09:15 GMT</pubDate>
      <guid>https://communities.sas.com/t5/ODS-and-Base-Reporting/How-to-highlight-specific-text-with-color-at-ODS-PDF-output/m-p/747966#M25069</guid>
      <dc:creator>jimbarbour</dc:creator>
      <dc:date>2021-06-14T21:09:15Z</dc:date>
    </item>
    <item>
      <title>Re: How to highlight specific text with color at ODS PDF output?</title>
      <link>https://communities.sas.com/t5/ODS-and-Base-Reporting/How-to-highlight-specific-text-with-color-at-ODS-PDF-output/m-p/748005#M25073</link>
      <description>Hi:&lt;BR /&gt;  Yes, &lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/37107"&gt;@jimbarbour&lt;/a&gt;'s choice b is the answer. I always explain it to my students this way when they ask if something is possible (like can I change the page number to the bottom of the page) -- The answer is "It depends on the destination" -- RTF and PDF -- yes; HTML -- No, ODS Excel, yes, but you have to use Microsoft specific field codes to do it.&lt;BR /&gt;&lt;BR /&gt;  The way I understand PDF is that PDF "wants" the background color to apply to the entire data cell. So foreground color for part of the string is OK. But background color doesn't work for inline formatting because PDF wants the whole cell to have the same background. It's different for RTF and Word because, well, Microsoft.&lt;BR /&gt;&lt;BR /&gt;Cynthia</description>
      <pubDate>Tue, 15 Jun 2021 01:15:00 GMT</pubDate>
      <guid>https://communities.sas.com/t5/ODS-and-Base-Reporting/How-to-highlight-specific-text-with-color-at-ODS-PDF-output/m-p/748005#M25073</guid>
      <dc:creator>Cynthia_sas</dc:creator>
      <dc:date>2021-06-15T01:15:00Z</dc:date>
    </item>
    <item>
      <title>Re: How to highlight specific text with color at ODS PDF output?</title>
      <link>https://communities.sas.com/t5/ODS-and-Base-Reporting/How-to-highlight-specific-text-with-color-at-ODS-PDF-output/m-p/748006#M25074</link>
      <description>&lt;P&gt;Thank you,&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/13549"&gt;@Cynthia_sas&lt;/a&gt;.&amp;nbsp; It's about time somebody showed up around here who actually knows what they're talking about...&amp;nbsp;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Jim&lt;/P&gt;</description>
      <pubDate>Tue, 15 Jun 2021 01:17:18 GMT</pubDate>
      <guid>https://communities.sas.com/t5/ODS-and-Base-Reporting/How-to-highlight-specific-text-with-color-at-ODS-PDF-output/m-p/748006#M25074</guid>
      <dc:creator>jimbarbour</dc:creator>
      <dc:date>2021-06-15T01:17:18Z</dc:date>
    </item>
  </channel>
</rss>

