For Documents, Invoices or attachments in mails there are many possibilities to generate your own pdf on a server. What would you use today in a typical PHP app?
I use SVG for the browser and for PDF/printing I reuse the same SVG plus some text, also in SVG for simplicity and then run this combined SVG through SVG2PDF service. The service is dead simple and up for grabs for everyone: https://github.com/kika/svg2pdf
wkhtmltopdf is also my choice for everyday, it's easy to use in few lines of code.
I've seen wkhtmltopdf (a command line tool) being used in a production level application, to generate complex data visualisation reports. It is highly configurable, and with a lot of wrappers present which would enable it to be used with any language of choice; it would be my first bet.
Sometime ago I generated PDFs on server using ColdFusion which had some nice PDF generation functions/tags. Since moving on from ColdFusion to NodeJS I've used DocRaptor which has been excellent: https://docraptor.com/
The main downside is pricing approach which is tiered and not simply credit based (like Postmark) and no easy way to set an account to idle. These may not be big issues to you. I have one application that is highly seasonal so really need pricing to handle high peaks and then many months with zero usage.
DocRaptor has API samples for PHP, Ruby, NodeJS and others. It can also handle XLS.
All said the ease of use and not having to worry about uptime is well worth it for me.
Apache FOP2 is awesome, I embed it in Java, but it can also run on its own which means PHP can call it externally and simply forward the generated PDF / PNG / SVG / etc.
It also handles page breaks all by itself, you can specify the templates in millimeters / inches if you want to take an on-paper design and replicate it onto a template inch by inch, encrypt / password protect PDFs and so forth. I can't think of anything PDF-wise it can't do.
I use MDPF - https://github.com/mpdf/mpdf it's incredibly easy to convert html to a PDF although it's css support is limited, but for doing typical invoice layouts it's great.
I use JS PDF and it works quite well to generate a 20+ page report on demand.
It's still a bit of a pain determining new page breaks, but if you understand what will be outputted, you can work around it.
I would probably render the page using phantomjs with php libs like https://github.com/jonnnnyw/php-phantomjs. So that most of my styles will be rendered as in my html output
Darius
DOMPDF is my weapon of choice: https://github.com/dompdf/dompdf