<?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: Generate PDF while using _webout in data step in Developers</title>
    <link>https://communities.sas.com/t5/Developers/Generate-PDF-while-using-webout-in-data-step/m-p/512032#M5794</link>
    <description>&lt;P&gt;&lt;FONT face="verdana,geneva"&gt;Can you share the log for the code that is failing?&amp;nbsp; Something like this should work:&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;%let _ODSDEST=pdf;

%let RV = %sysfunc(appsrv_header(Content-type, application/pdf));
%let RV = %sysfunc(appsrv_header(Content-disposition, %str(attachment; )filename="temp.pdf"));

%STPBEGIN()

proc print data=sashelp.class; run; quit;

%STPEND()&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="verdana,geneva"&gt;Vince DelGobbo&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="verdana,geneva"&gt;SAS R&amp;amp;D&lt;/FONT&gt;&lt;/P&gt;</description>
    <pubDate>Sun, 11 Nov 2018 20:51:57 GMT</pubDate>
    <dc:creator>Vince_SAS</dc:creator>
    <dc:date>2018-11-11T20:51:57Z</dc:date>
    <item>
      <title>Generate PDF while using _webout in data step</title>
      <link>https://communities.sas.com/t5/Developers/Generate-PDF-while-using-webout-in-data-step/m-p/509944#M5792</link>
      <description>&lt;P&gt;Hello Team,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am looking for the sample code which can generate and allow user to download the PDF file while using the _webout in data step( data _null_) in stored process.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&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-left" image-alt="Capture.JPG" style="width: 511px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/24601i660DFA3F0AF8F79F/image-size/large?v=v2&amp;amp;px=999" role="button" title="Capture.JPG" alt="Capture.JPG" /&gt;&lt;/span&gt;I have tried multiple options using the below content disposition but it is allowing me to download the pdf file but giving an error while opening downloaded PDF file, attached screenshot for your reference.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;%let RV = %sysfunc(appsrv_header(Content-type, application/pdf));&lt;BR /&gt;%let RV = %sysfunc(appsrv_header(Content-disposition, %str(attachment; )filename=temp.pdf));&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Please note, STP code is working fine and able to generate RTF and Excel.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks and Regards,&lt;/P&gt;&lt;P&gt;Dipan Arya&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 02 Nov 2018 16:20:26 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Developers/Generate-PDF-while-using-webout-in-data-step/m-p/509944#M5792</guid>
      <dc:creator>dipanarya1</dc:creator>
      <dc:date>2018-11-02T16:20:26Z</dc:date>
    </item>
    <item>
      <title>Re: Generate PDF while using _webout in data step</title>
      <link>https://communities.sas.com/t5/Developers/Generate-PDF-while-using-webout-in-data-step/m-p/509965#M5793</link>
      <description>&lt;P&gt;First of all, try opening your .pdf file in notepad - if there are errors, it will actually contain the log.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Secondly, use the `stpsrv()` function methods, as these replace the IntrNet `appsrv` equivalents.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thirdly, don't try and write directly to _webout.&amp;nbsp; Instead, write to disk and then stream it as binary content (eg with this &lt;A href="https://raw.githubusercontent.com/Boemska/macrocore/master/base/mp_binarycopy.sas" target="_self"&gt;macro&lt;/A&gt;), this way you can at least inspect the file before it is sent (as well as manage multi step PDF writes).&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Finally, be sure that you haven't used `%stpbegin` or sent any other content to the destination beforehand.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Good luck..&lt;/P&gt;</description>
      <pubDate>Fri, 02 Nov 2018 17:02:15 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Developers/Generate-PDF-while-using-webout-in-data-step/m-p/509965#M5793</guid>
      <dc:creator>AllanBowe</dc:creator>
      <dc:date>2018-11-02T17:02:15Z</dc:date>
    </item>
    <item>
      <title>Re: Generate PDF while using _webout in data step</title>
      <link>https://communities.sas.com/t5/Developers/Generate-PDF-while-using-webout-in-data-step/m-p/512032#M5794</link>
      <description>&lt;P&gt;&lt;FONT face="verdana,geneva"&gt;Can you share the log for the code that is failing?&amp;nbsp; Something like this should work:&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;%let _ODSDEST=pdf;

%let RV = %sysfunc(appsrv_header(Content-type, application/pdf));
%let RV = %sysfunc(appsrv_header(Content-disposition, %str(attachment; )filename="temp.pdf"));

%STPBEGIN()

proc print data=sashelp.class; run; quit;

%STPEND()&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="verdana,geneva"&gt;Vince DelGobbo&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="verdana,geneva"&gt;SAS R&amp;amp;D&lt;/FONT&gt;&lt;/P&gt;</description>
      <pubDate>Sun, 11 Nov 2018 20:51:57 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Developers/Generate-PDF-while-using-webout-in-data-step/m-p/512032#M5794</guid>
      <dc:creator>Vince_SAS</dc:creator>
      <dc:date>2018-11-11T20:51:57Z</dc:date>
    </item>
    <item>
      <title>Re: Generate PDF while using _webout in data step</title>
      <link>https://communities.sas.com/t5/Developers/Generate-PDF-while-using-webout-in-data-step/m-p/512218#M5795</link>
      <description>&lt;P&gt;Hello &lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/13635"&gt;@Vince_SAS&lt;/a&gt;,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks for your reply.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The pdf is getting generated with HTML tag used in the data step using _webout. i have tried to open it using notepad.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Can you please suggest any workaround?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks and Regards,&lt;/P&gt;&lt;P&gt;Dipan Arya&lt;/P&gt;</description>
      <pubDate>Mon, 12 Nov 2018 15:13:25 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Developers/Generate-PDF-while-using-webout-in-data-step/m-p/512218#M5795</guid>
      <dc:creator>dipanarya1</dc:creator>
      <dc:date>2018-11-12T15:13:25Z</dc:date>
    </item>
    <item>
      <title>Re: Generate PDF while using _webout in data step</title>
      <link>https://communities.sas.com/t5/Developers/Generate-PDF-while-using-webout-in-data-step/m-p/512226#M5796</link>
      <description>&lt;P&gt;&lt;FONT face="verdana,geneva"&gt;I don't understand what your code is doing.&amp;nbsp; You need to show the code or the log, or both.&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="verdana,geneva"&gt;Vince DelGobbo&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="verdana,geneva"&gt;SAS R&amp;amp;D&lt;/FONT&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 12 Nov 2018 15:30:17 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Developers/Generate-PDF-while-using-webout-in-data-step/m-p/512226#M5796</guid>
      <dc:creator>Vince_SAS</dc:creator>
      <dc:date>2018-11-12T15:30:17Z</dc:date>
    </item>
    <item>
      <title>Re: Generate PDF while using _webout in data step</title>
      <link>https://communities.sas.com/t5/Developers/Generate-PDF-while-using-webout-in-data-step/m-p/512230#M5797</link>
      <description>&lt;P&gt;Hello&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/13635"&gt;@Vince_SAS&lt;/a&gt;,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks for quick reply.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Please find attached log for your reference.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks and Regards,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Dipan Arya&lt;/P&gt;</description>
      <pubDate>Tue, 13 Nov 2018 05:38:28 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Developers/Generate-PDF-while-using-webout-in-data-step/m-p/512230#M5797</guid>
      <dc:creator>dipanarya1</dc:creator>
      <dc:date>2018-11-13T05:38:28Z</dc:date>
    </item>
    <item>
      <title>Re: Generate PDF while using _webout in data step</title>
      <link>https://communities.sas.com/t5/Developers/Generate-PDF-while-using-webout-in-data-step/m-p/512236#M5798</link>
      <description>&lt;P&gt;Hello &lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/13635"&gt;@Vince_SAS&lt;/a&gt;,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Also attaching the PDF file which is being generated by the code after adding your suggested options to generate PDF.&lt;/P&gt;&lt;P&gt;i have tried to open the file and i can see the HTML TAGs in the PDF file.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks and Regards,&lt;/P&gt;&lt;P&gt;Dipan Arya&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 13 Nov 2018 05:37:02 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Developers/Generate-PDF-while-using-webout-in-data-step/m-p/512236#M5798</guid>
      <dc:creator>dipanarya1</dc:creator>
      <dc:date>2018-11-13T05:37:02Z</dc:date>
    </item>
    <item>
      <title>Re: Generate PDF while using _webout in data step</title>
      <link>https://communities.sas.com/t5/Developers/Generate-PDF-while-using-webout-in-data-step/m-p/512241#M5799</link>
      <description>&lt;P&gt;&lt;FONT face="verdana,geneva"&gt;The "temp.pdf" file in the ZIP archive that you attached is not a PDF file.&amp;nbsp; It is an HTML file.&amp;nbsp; Adobe Reader cannot open HTML files.&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="verdana,geneva"&gt;You need to change the logic of your program to create a PDF file when that is the desired type of output.&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="verdana,geneva"&gt;Vince DelGobbo&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="verdana,geneva"&gt;SAS R&amp;amp;D&lt;/FONT&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 12 Nov 2018 16:02:41 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Developers/Generate-PDF-while-using-webout-in-data-step/m-p/512241#M5799</guid>
      <dc:creator>Vince_SAS</dc:creator>
      <dc:date>2018-11-12T16:02:41Z</dc:date>
    </item>
    <item>
      <title>Re: Generate PDF while using _webout in data step</title>
      <link>https://communities.sas.com/t5/Developers/Generate-PDF-while-using-webout-in-data-step/m-p/512243#M5800</link>
      <description>&lt;P&gt;Hello&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/13635"&gt;@Vince_SAS&lt;/a&gt;,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks for quick reply.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;If you check the log file, i applied the _odsdest =pdf and commands to set "appsrv_header" to generate PDF and Initially&amp;nbsp;i also mentioned that the PDF is generated but with the HTML tags. we are using same process to generate the excel and RTF which is working fine but for pdf it is exported with the HTML Tags.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Requesting your help.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks and Regards,&lt;/P&gt;&lt;P&gt;Dipan Arya&lt;/P&gt;</description>
      <pubDate>Mon, 12 Nov 2018 16:12:46 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Developers/Generate-PDF-while-using-webout-in-data-step/m-p/512243#M5800</guid>
      <dc:creator>dipanarya1</dc:creator>
      <dc:date>2018-11-12T16:12:46Z</dc:date>
    </item>
    <item>
      <title>Re: Generate PDF while using _webout in data step</title>
      <link>https://communities.sas.com/t5/Developers/Generate-PDF-while-using-webout-in-data-step/m-p/512248#M5801</link>
      <description>&lt;P&gt;&lt;FONT face="verdana,geneva"&gt;Yes, I saw that.&amp;nbsp; I also saw DATA step code that writes HTML to _WEBOUT:&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;MPRINT(MAC_REPORT):   data _null_;
MPRINT(MAC_REPORT):   file _webout;
MPRINT(MAC_REPORT):   PUT '&amp;lt;HTML&amp;gt;';
MPRINT(MAC_REPORT):   PUT '&amp;lt;HEAD&amp;gt;';
MPRINT(MAC_REPORT):   PUT '&amp;lt;STYLE&amp;gt;';
MPRINT(MAC_REPORT):   PUT 'TD {';
MPRINT(MAC_REPORT):   put 'font-family:arial;font-size:12px;BORDER-COLOR:BLACK;border-style:SOLID;border-width:1px;text-align: RIGHT;vertical-align: text-bottom; height: 25px';
MPRINT(MAC_REPORT):   put '}';

...&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&lt;FONT face="verdana,geneva"&gt;&amp;nbsp;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="verdana,geneva"&gt;This is the HTML that I see at the beginning of what you think is a PDF file.&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="verdana,geneva"&gt;Microsoft Excel and Microsoft Word can open HTML files, and I suspect that is why it "worked" there.&amp;nbsp; You did not create true Excel or RTF files.&amp;nbsp; When you opened the file with Excel and Word you&amp;nbsp;probably got&amp;nbsp;messages indicating that the file type didn't match the file contents.&amp;nbsp; It is trying to tell you that you don't have the type of file that you think that you have.&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="verdana,geneva"&gt;Vince DelGobbo&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="verdana,geneva"&gt;SAS R&amp;amp;D&lt;/FONT&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 12 Nov 2018 16:24:15 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Developers/Generate-PDF-while-using-webout-in-data-step/m-p/512248#M5801</guid>
      <dc:creator>Vince_SAS</dc:creator>
      <dc:date>2018-11-12T16:24:15Z</dc:date>
    </item>
    <item>
      <title>Re: Generate PDF while using _webout in data step</title>
      <link>https://communities.sas.com/t5/Developers/Generate-PDF-while-using-webout-in-data-step/m-p/512271#M5802</link>
      <description>Thanks again &lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/13635"&gt;@Vince_SAS&lt;/a&gt;.&lt;BR /&gt;&lt;BR /&gt;We have to used the HTML tags due to some specific requirements.&lt;BR /&gt;&lt;BR /&gt;Can you please suggest an approach to generate PDF while using the HTML tags in _webout.&lt;BR /&gt;&lt;BR /&gt;Thanks and Regards,&lt;BR /&gt;Dipan Arya</description>
      <pubDate>Mon, 12 Nov 2018 17:13:53 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Developers/Generate-PDF-while-using-webout-in-data-step/m-p/512271#M5802</guid>
      <dc:creator>dipanarya1</dc:creator>
      <dc:date>2018-11-12T17:13:53Z</dc:date>
    </item>
    <item>
      <title>Re: Generate PDF while using _webout in data step</title>
      <link>https://communities.sas.com/t5/Developers/Generate-PDF-while-using-webout-in-data-step/m-p/512272#M5803</link>
      <description>&lt;P&gt;&lt;FONT face="verdana,geneva"&gt;You probably need to get a product that converts HTML to PDF, and then return the resulting PDF file.&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="verdana,geneva"&gt;Vince DelGobbo&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="verdana,geneva"&gt;SAS R&amp;amp;D&lt;/FONT&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 12 Nov 2018 17:15:58 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Developers/Generate-PDF-while-using-webout-in-data-step/m-p/512272#M5803</guid>
      <dc:creator>Vince_SAS</dc:creator>
      <dc:date>2018-11-12T17:15:58Z</dc:date>
    </item>
    <item>
      <title>Re: Generate PDF while using _webout in data step</title>
      <link>https://communities.sas.com/t5/Developers/Generate-PDF-while-using-webout-in-data-step/m-p/512276#M5804</link>
      <description>Can you please suggest any product?</description>
      <pubDate>Mon, 12 Nov 2018 17:41:17 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Developers/Generate-PDF-while-using-webout-in-data-step/m-p/512276#M5804</guid>
      <dc:creator>dipanarya1</dc:creator>
      <dc:date>2018-11-12T17:41:17Z</dc:date>
    </item>
    <item>
      <title>Re: Generate PDF while using _webout in data step</title>
      <link>https://communities.sas.com/t5/Developers/Generate-PDF-while-using-webout-in-data-step/m-p/512285#M5805</link>
      <description>&lt;P&gt;&lt;FONT face="verdana,geneva"&gt;I have never used any.&amp;nbsp; You will have to search the Web for a product.&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="verdana,geneva"&gt;Vince DelGobbo&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="verdana,geneva"&gt;SAS R&amp;amp;D&lt;/FONT&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 12 Nov 2018 17:52:43 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Developers/Generate-PDF-while-using-webout-in-data-step/m-p/512285#M5805</guid>
      <dc:creator>Vince_SAS</dc:creator>
      <dc:date>2018-11-12T17:52:43Z</dc:date>
    </item>
  </channel>
</rss>

