<?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: URL path generated in PDF with '#' symbol is incomplete in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/URL-path-generated-in-PDF-with-symbol-is-incomplete/m-p/758026#M239310</link>
    <description>&lt;P&gt;From the wikipedia article for &lt;A href="https://en.wikipedia.org/wiki/URL#Syntax" target="_blank" rel="noopener"&gt;URL/URI&lt;/A&gt;:&lt;/P&gt;
&lt;UL&gt;
&lt;LI&gt;An optional &lt;STRONG&gt;&lt;SPAN class="vanchor"&gt;&lt;SPAN class="vanchor-text"&gt;fragment&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/STRONG&gt; component preceded by a &lt;A title="Number sign" href="https://en.wikipedia.org/wiki/Number_sign" target="_blank"&gt;hash&lt;/A&gt; (&lt;CODE&gt;#&lt;/CODE&gt;). The fragment contains a &lt;A class="mw-redirect" title="Fragment identifier" href="https://en.wikipedia.org/wiki/Fragment_identifier" target="_blank"&gt;fragment identifier&lt;/A&gt; providing direction to a secondary resource, such as a section heading in an article identified by the remainder of the URI. When the primary resource is an &lt;A title="HTML" href="https://en.wikipedia.org/wiki/HTML" target="_blank"&gt;HTML&lt;/A&gt; document, the fragment is often an &lt;A title="HTML" href="https://en.wikipedia.org/wiki/HTML#Attributes" target="_blank"&gt;&lt;CODE&gt;id&lt;/CODE&gt; attribute&lt;/A&gt; of a specific element, and web browsers will scroll this element into view.&lt;/LI&gt;
&lt;/UL&gt;
&lt;P&gt;As you can see, the hash sign has a special meaning in URI's and must not be used for anything else.&lt;/P&gt;
&lt;P&gt;(When you define an anchor in a HTML page, the # syntax is used to place the browser directly there)&lt;/P&gt;
&lt;P&gt;Bottom line: don't use special characters in filenames, unless you want to run into trouble later.&lt;/P&gt;</description>
    <pubDate>Thu, 29 Jul 2021 10:13:27 GMT</pubDate>
    <dc:creator>Kurt_Bremser</dc:creator>
    <dc:date>2021-07-29T10:13:27Z</dc:date>
    <item>
      <title>URL path generated in PDF with '#' symbol is incomplete</title>
      <link>https://communities.sas.com/t5/SAS-Programming/URL-path-generated-in-PDF-with-symbol-is-incomplete/m-p/757959#M239284</link>
      <description>&lt;P&gt;Hi I am trying to create a PDF hyperlink using t.format_cell method. But one the URL path contains '#' symbol and because of it the hyperlink generated becomes invalid. And the URL generated do not contain the text/path after '#' symbol.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;In the example below, the actual File path is&amp;nbsp;&lt;STRONG&gt;'file:///test/file/path/Information #51801.msg'&lt;/STRONG&gt; but in PDF generated it is&amp;nbsp;&lt;STRONG&gt;'file:///test/file/path/Information '&lt;/STRONG&gt;&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-right" image-alt="URL_Error.PNG" style="width: 400px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/62036iA79293CFBF86E079/image-size/medium?v=v2&amp;amp;px=400" role="button" title="URL_Error.PNG" alt="URL_Error.PNG" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;Code:&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;%let file_name ='Additional Information';
%let url_path = 'file:///test/file/path/Information #51801.msg';

proc template;
	define style work.sample;
	parent=styles.pearl;

style TableBase/
     cellpadding=2pt
     verticalalign=top
    ;

style TextUnderline from Body  /
     borderbottomcolor=black
     borderbottomwidth=1pt
     textindent=10
     height=20pt
     fontsize=8pt
    ; 
	end;
run;
%put %STR(NOTE: Build the report ... );

ods escapechar='~';
%let outpath=/sas_data/pdf_location;
ods pdf 
  file="&amp;amp;outpath./output_file.pdf"   
  ;

ods trace on/ label;
data _null_;
declare odsout t();

 t.table_start( name: 'Attachments', style: 'TableBase', overrides: 'width=190mm');

   t.row_start();
      t.format_cell(Text: "" );
      t.format_cell(text: &amp;amp;file_name
          , style: 'TextUnderline'
          , url: &amp;amp;url_path, overrides:"color=blue" 
          ,overrides:'');
  t.row_end();
 t.table_end();
run;
ods pdf close;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 28 Jul 2021 23:22:45 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/URL-path-generated-in-PDF-with-symbol-is-incomplete/m-p/757959#M239284</guid>
      <dc:creator>Soundappan</dc:creator>
      <dc:date>2021-07-28T23:22:45Z</dc:date>
    </item>
    <item>
      <title>Re: URL path generated in PDF with '#' symbol is incomplete</title>
      <link>https://communities.sas.com/t5/SAS-Programming/URL-path-generated-in-PDF-with-symbol-is-incomplete/m-p/757963#M239287</link>
      <description>&lt;P&gt;I think the problem is the embedded blank not the # sign.&amp;nbsp; Try getting rid of the embedded blank.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Jim&lt;/P&gt;</description>
      <pubDate>Wed, 28 Jul 2021 23:42:10 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/URL-path-generated-in-PDF-with-symbol-is-incomplete/m-p/757963#M239287</guid>
      <dc:creator>jimbarbour</dc:creator>
      <dc:date>2021-07-28T23:42:10Z</dc:date>
    </item>
    <item>
      <title>Re: URL path generated in PDF with '#' symbol is incomplete</title>
      <link>https://communities.sas.com/t5/SAS-Programming/URL-path-generated-in-PDF-with-symbol-is-incomplete/m-p/758023#M239308</link>
      <description>&lt;P&gt;Hi Jim,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks for responding. No it did not work, the black space is getting parsed without issue, but when it comes to '#' symbol, it get cutoff.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Actual URL Path -&amp;nbsp;&lt;STRONG&gt;'file:///test/file/path/Information doc#51801.msg'&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;URL in PDF -&lt;STRONG&gt; 'file:///test/file/path/Information doc'&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;URL generated in PDF,&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="URL_Error1.PNG" style="width: 400px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/62049i29CA85DD9104E639/image-size/medium?v=v2&amp;amp;px=400" role="button" title="URL_Error1.PNG" alt="URL_Error1.PNG" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;Soundappan&lt;/P&gt;</description>
      <pubDate>Thu, 29 Jul 2021 10:00:46 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/URL-path-generated-in-PDF-with-symbol-is-incomplete/m-p/758023#M239308</guid>
      <dc:creator>Soundappan</dc:creator>
      <dc:date>2021-07-29T10:00:46Z</dc:date>
    </item>
    <item>
      <title>Re: URL path generated in PDF with '#' symbol is incomplete</title>
      <link>https://communities.sas.com/t5/SAS-Programming/URL-path-generated-in-PDF-with-symbol-is-incomplete/m-p/758026#M239310</link>
      <description>&lt;P&gt;From the wikipedia article for &lt;A href="https://en.wikipedia.org/wiki/URL#Syntax" target="_blank" rel="noopener"&gt;URL/URI&lt;/A&gt;:&lt;/P&gt;
&lt;UL&gt;
&lt;LI&gt;An optional &lt;STRONG&gt;&lt;SPAN class="vanchor"&gt;&lt;SPAN class="vanchor-text"&gt;fragment&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/STRONG&gt; component preceded by a &lt;A title="Number sign" href="https://en.wikipedia.org/wiki/Number_sign" target="_blank"&gt;hash&lt;/A&gt; (&lt;CODE&gt;#&lt;/CODE&gt;). The fragment contains a &lt;A class="mw-redirect" title="Fragment identifier" href="https://en.wikipedia.org/wiki/Fragment_identifier" target="_blank"&gt;fragment identifier&lt;/A&gt; providing direction to a secondary resource, such as a section heading in an article identified by the remainder of the URI. When the primary resource is an &lt;A title="HTML" href="https://en.wikipedia.org/wiki/HTML" target="_blank"&gt;HTML&lt;/A&gt; document, the fragment is often an &lt;A title="HTML" href="https://en.wikipedia.org/wiki/HTML#Attributes" target="_blank"&gt;&lt;CODE&gt;id&lt;/CODE&gt; attribute&lt;/A&gt; of a specific element, and web browsers will scroll this element into view.&lt;/LI&gt;
&lt;/UL&gt;
&lt;P&gt;As you can see, the hash sign has a special meaning in URI's and must not be used for anything else.&lt;/P&gt;
&lt;P&gt;(When you define an anchor in a HTML page, the # syntax is used to place the browser directly there)&lt;/P&gt;
&lt;P&gt;Bottom line: don't use special characters in filenames, unless you want to run into trouble later.&lt;/P&gt;</description>
      <pubDate>Thu, 29 Jul 2021 10:13:27 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/URL-path-generated-in-PDF-with-symbol-is-incomplete/m-p/758026#M239310</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2021-07-29T10:13:27Z</dc:date>
    </item>
    <item>
      <title>Re: URL path generated in PDF with '#' symbol is incomplete</title>
      <link>https://communities.sas.com/t5/SAS-Programming/URL-path-generated-in-PDF-with-symbol-is-incomplete/m-p/758100#M239343</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/224541"&gt;@Soundappan&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;Thanks for responding. No it did not work, the black space is getting parsed without issue, but when it comes to '#' symbol, it get cutoff.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Actual URL Path -&amp;nbsp;&lt;STRONG&gt;'file:///test/file/path/Information doc#51801.msg'&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;URL in PDF -&lt;STRONG&gt; 'file:///test/file/path/Information doc'&lt;/STRONG&gt;&lt;/P&gt;
&lt;/BLOCKQUOTE&gt;
&lt;P&gt;Interesting.&amp;nbsp; Well, I think&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/11562"&gt;@Kurt_Bremser&lt;/a&gt;'s admonition to not use a "#" symbol because it has special meaning is probably sound.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Jim&lt;/P&gt;</description>
      <pubDate>Thu, 29 Jul 2021 14:21:45 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/URL-path-generated-in-PDF-with-symbol-is-incomplete/m-p/758100#M239343</guid>
      <dc:creator>jimbarbour</dc:creator>
      <dc:date>2021-07-29T14:21:45Z</dc:date>
    </item>
  </channel>
</rss>

