Why not create a PDF and email it to them as an attachment? 

That way they could have the PDF open and browser on something else?
Don't know if that works for you or not.
We do that a lot and users like it. But we also know their email from
their cookie at sign on.


 

-----Original Message-----
From: web400-bounces@xxxxxxxxxxxx [mailto:web400-bounces@xxxxxxxxxxxx]
On Behalf Of Ricky Thompson
Sent: Thursday, April 21, 2005 10:54 AM
To: web400@xxxxxxxxxxxx
Subject: [WEB400] Pushing a PDF file with CGIDEV2

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                                                              

--
This is the Web Enabling the AS400 / iSeries (WEB400) mailing list To
post a message email: WEB400@xxxxxxxxxxxx To subscribe, unsubscribe, or
change list options,
visit: http://lists.midrange.com/mailman/listinfo/web400
or email: WEB400-request@xxxxxxxxxxxx
Before posting, please take a moment to review the archives at
http://archive.midrange.com/web400.



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-2020 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].