<?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 Leading spaces in obj.format_text() in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Leading-spaces-in-obj-format-text/m-p/826604#M326502</link>
    <description>&lt;P&gt;Hi&lt;BR /&gt;I would like to use the obj-format_text method to insert text in a PDF-document. Some of the textstrings have leading spaces (hex 20), but hven the text is inserted, the leading spaces disappears&amp;nbsp;&lt;span class="lia-unicode-emoji" title=":crying_face:"&gt;😢&lt;/span&gt;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data test;

  text = '     With spaces'; output;  
  text = 'Without spaces  '; output;
run;

ods _all_ close;
ods pdf file = "e:\Test.pdf";

data _null_;
  set test;

  if _n_ = 1 then declare odsout obj();

  obj.format_text(data:        text,
                  format:      '$char25.', 
                  style_attr:  'font_size=6pt font=(courier)');
run;

ods pdf close;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;What to do, if I want to keep the leading spaces in the PDF-file ?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;This is what happens, at not what I want....&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-center" image-alt="Spaces.jpg" style="width: 999px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/74000i636A9B5B02DEBFC4/image-size/large?v=v2&amp;amp;px=999" role="button" title="Spaces.jpg" alt="Spaces.jpg" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Regards&lt;BR /&gt;Jens Vestergård&lt;/P&gt;
&lt;P&gt;LB Forsikring&lt;/P&gt;</description>
    <pubDate>Tue, 02 Aug 2022 11:54:45 GMT</pubDate>
    <dc:creator>JensVestergård</dc:creator>
    <dc:date>2022-08-02T11:54:45Z</dc:date>
    <item>
      <title>Leading spaces in obj.format_text()</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Leading-spaces-in-obj-format-text/m-p/826604#M326502</link>
      <description>&lt;P&gt;Hi&lt;BR /&gt;I would like to use the obj-format_text method to insert text in a PDF-document. Some of the textstrings have leading spaces (hex 20), but hven the text is inserted, the leading spaces disappears&amp;nbsp;&lt;span class="lia-unicode-emoji" title=":crying_face:"&gt;😢&lt;/span&gt;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data test;

  text = '     With spaces'; output;  
  text = 'Without spaces  '; output;
run;

ods _all_ close;
ods pdf file = "e:\Test.pdf";

data _null_;
  set test;

  if _n_ = 1 then declare odsout obj();

  obj.format_text(data:        text,
                  format:      '$char25.', 
                  style_attr:  'font_size=6pt font=(courier)');
run;

ods pdf close;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;What to do, if I want to keep the leading spaces in the PDF-file ?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;This is what happens, at not what I want....&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-center" image-alt="Spaces.jpg" style="width: 999px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/74000i636A9B5B02DEBFC4/image-size/large?v=v2&amp;amp;px=999" role="button" title="Spaces.jpg" alt="Spaces.jpg" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Regards&lt;BR /&gt;Jens Vestergård&lt;/P&gt;
&lt;P&gt;LB Forsikring&lt;/P&gt;</description>
      <pubDate>Tue, 02 Aug 2022 11:54:45 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Leading-spaces-in-obj-format-text/m-p/826604#M326502</guid>
      <dc:creator>JensVestergård</dc:creator>
      <dc:date>2022-08-02T11:54:45Z</dc:date>
    </item>
    <item>
      <title>Re: Leading spaces in obj.format_text()</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Leading-spaces-in-obj-format-text/m-p/826607#M326504</link>
      <description>&lt;P&gt;I think this is caused by the&amp;nbsp;&lt;SPAN&gt;horizontal justification of the&amp;nbsp;&lt;/SPAN&gt;&lt;A href="https://documentation.sas.com/doc/en/pgmsascdc/9.4_3.5/odsadvug/n0gm6bj5nzz1x2n1xa4a62iye8ni.htm" target="_self"&gt;FORMAT_TEXT Method&lt;/A&gt;, which is Just : 'L' (left align) by default.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 02 Aug 2022 12:13:47 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Leading-spaces-in-obj-format-text/m-p/826607#M326504</guid>
      <dc:creator>PeterClemmensen</dc:creator>
      <dc:date>2022-08-02T12:13:47Z</dc:date>
    </item>
  </channel>
</rss>

