What I am doing is trying to send to the browser a PDF version of a websale receipt. I have the code written in 4D that creats the pdf document in a blob and then sends it via SEND HTML BLOB. Since you can not call this command from within an Active4D page, I have to use the A4D_PreOnWebConnectionHook you wrote into the the On Web Connection method.

Forget about the PreOnWebConnectionHook, there is a much, much better way through Active4D.


// Figure out the content to put in the receipt
c_blob($pdf)
$pdf:=GeneratePDF  // GeneratePDF is your 4D method
write blob($pdf; "application/pdf")

Pretty simple. The 'write blob' command is the equivalent of SEND HTML BLOB.

Do whatever setup you need before calling GeneratePDF, or pass it some parameters. This way you have full (and easy) access to the web environment, without wasting your time parsing the request yourself. That's why you are using Active4D in the first place!

Regards,

   Aparajita
   Victory-Heart Productions
   [EMAIL PROTECTED]
   www.aparajitaworld.com

   "If you dare to fail, you are bound to succeed."
   - Sri Chinmoy   |   www.srichinmoylibrary.com



Reply via email to