How to generate PDF documents in Oracle APEX?
Sometimes one gets the feeling that something is needlessly difficult. This is one of these things, and the difficulty has some history.
Apache FOP is probably as close as one can get to an industry standard facility for creasting PDFs. Oracle used to include a fop.war file with APEX. That stopped with APEX 5. Not a problem because round about then, ORDS was enhanced to include FOP. That was fine up to ORDS 19.4, when Oracle removed FOP from ORDS. Supposedly not an issue, because from APEX 20.1, PDF generation is included within APEX itself.
But! The PDF generation now included with APEX is nowhere near good enough for most people. For example, you cannot embed an image in the output file. We tried compiling our own fop.war (there are some edits you have to do first to make it work with APEX) and using it to generate PDFs but we could not get it to do anything more than basic stuff. So unless you are a FOP wizard, you probably have to use a paid-for solution. There are several possibilities, these are the three we have considered: Apex Office Print, PL/PDF, and BI Publisher.
BI Pub seems like massive overkill for something so minor. After all, the PDF generation is just one servlet. Why do you need the whole WebLogic stack just for that?
AOP is designed to work with APEX, and it does so brilliantly. Straightforward to use, well documented and supported. PL/PDF is a bit more daunting, you need to invest more time in becoming familiar with it: You are writing PL/SQL code. It does however give you more control and does not have any dependency on APEX. We have clients using both very effectively.
To conclude, if you want fancy reports you’ll probably want to license either AOP or PL/PDF. They are both good tools, with their own plusses and minusses, and of course various pricing options. There isn’t really a decent cost-free option any more.