I explored some more and found we have in fact two cairo-based PDF export systems: CairoPdfOutput and CairoRendererPdfOutput. The first is used for save as PDF (I'm not sure what and how is used for PDF print, because I don't know how to "print with PDF" - can anyone please clarify); the second is, as far as I can see, unused (commented out in extension/init.cpp). I have reenabled it and compared the output of these two systems.
The now-disabled CairoRendererPdfOutput:
- supports clipping
- supports font kern pairs (both methods support SVG kerning)
- seems to have a better support for pattern fills and masks - though still broken, but at least has some infrastructure for them
- has a direct access to the document tree, instead of using the print calls as the now-active CairoPdfOutput does
On the other hand, the now-active CairoPdfOutput:
- supports the export-what parameters (canvas, drawing, object id) and text to path
So, based on this comparison, I tend to think that we should purge CairoPdfOutput in favor of CairoRendererPdfOutput. I especially like about the latter that, thanks to direct document tree access, it is much easier to implement things like clipping; adding clipping to CairoPdfOutput would require a quite clumsy and invasive change to the print interface.
So, my question is, does anyone have an idea why CairoPdfOutput was enabled and CairoRendererPdfOutput was disabled in the first place? Was there some limitation of the latter that I'm unaware of? Will anyone object if I add to it the missing parameters and reenable it in place of CairoPdfOutput?