This is really quite simple. By default, the pl_fpdf.output procedure will "print" your PDF document to the web browser along with a header that instructs the browser that this is a downloadable document. All you need to do is to call your procedure that generates the PDF document from a page process within Apex.
Here are the steps:
1. Start by compiling the demo procedure from my previous post into the parsing schema of your Apex application.
2. In Apex, go to your application and add a new, blank page. Let's assume the new page number is 4.
3. Under the "Page Rendering" section, add a new Process of type "PL/SQL". The name of the process can be anything, but let's call it "Produce PDF". Make sure that the point is "On load - before header".
4. In the process source, add the following PL/SQL code:
begin -- call the procedure to generate the PDF document and send it to the browser test_pl_fpdf; -- stop the Apex engine from running the rest of the page apex_application.g_unrecoverable_error := true; end;
5. Add a link to the new page (page number 4 if you follow my assumption in step 2) from any other page in the application.
6. Run the application. Now, whenever you navigate to page 4 the PDF file will be downloaded to the browser.
That's all you need to integrate PDF generation into your Apex application.