× The internal search function is temporarily non-functional. The current search engine is no longer viable and we are researching alternatives.
As a stop gap measure, we are using Google's custom search engine service.
If you know of an easy to use, open source, search engine ... please contact support@midrange.com.



Can I push a PDF file out to a web browser?

 

I wrote the following RPG program thinking it would work but I get garbage.
We are wanting to dynamically produce the PDF and then push to the user.
The main reason I wanted to push it out was so that I could delete the PDF
as soon as they are done.  Am I going about this the wrong way?

 

 /copy cgidev2/qrpglesrc,hspecs                        

 /copy cgidev2/qrpglesrc,hspecsbnd                     

F*                                                     

 /copy cgidev2/qrpglesrc,prototypeb                    

 /copy cgidev2/qrpglesrc,usec                          

 /copy cgidev2/qrpglesrc,variables3                    

D IfsInpBuff      s          65535a   varying          

D InpBuffLen      s             10i 0                  

D IfsObj          s            255a                    

D FileHandle      s             10i 0                  

D ReturnInt       s             10i 0                  

D BytesIn         s             10i 0                  

 /copy cgidev2/qrpglesrc,prolog3                       

 /free                                                 

     clrhtmlBuffer();                                  

     gethtml('QHTMLSRC':'CGILIB':'EMLACK');            

     wrtsection('start');                              

     IfsObj = '/reports/293254.pdf';   

  //  1-Open the IFS file                              

  //  1-Open the IFS file                                               

     FileHandle = open(%trim(IfsObj) : O_RDONLY + O_TEXTDATA);          

  //  2-Read the IFS file                                               

     BytesIn = read(FileHandle : %addr(IfsInpBuff) :  %size(IfsInpBuff) :
%size(IfsInpBuff));  

  //  3-Close the IFS file                                              

     ReturnInt = close(FileHandle);                                     

     IfsInpBuff = %trim(IfsInpBuff);                                    

  //  Insert the string read into the CGI output buffer                 

     InpBuffLen = %checkr(' ':IfsInpBuff);                              

     WrtNoSection(%addr(IfsInpBuff): InpBuffLen);                       

     wrtsection('*fini');                                               

     *INLR = *On;                                                       

 /end-free                                                              


As an Amazon Associate we earn from qualifying purchases.

This thread ...

Follow-Ups:

Follow On AppleNews
Return to Archive home page | Return to MIDRANGE.COM home page

This mailing list archive is Copyright 1997-2024 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].

Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.