I am in the process of creating a module that shows a custom form which when submitted returns a PDF document that is generated on the fly. The document has content that is merged from additional tables I have created in the Drupal DB. What I have not been able to figure out is how to respond directly to the sumbit request by sending back the generated PDF document.
Using drupal_goto to send back a URL to the PDF generating script (PHP) is not an attractive option - I would not have easy access to Drupal user data from an independent PHP script. (Not sure that is clear).
Briefly what I want is this
a. User clicks on Submit
b. Validate sumbitted form values, pick up user information from my extra Drupal DB tables.
c. Generate the merged PDF
d. Squirt back the PDF as the response to the submit
I'd much appreciate any help.