C++. You could use Qt and there are probably a bazillion PDF generation libraries - it's not that hard to make your own really depending on what you need to output.
QTPDF (used in QGIS) supports it, but the output quality is sub-par when working with Illustrator, at least in my experience. This could be a bug in QGIS, yes. But I didn't want to invest time into something that would probably fail (if the QGIS team failed using it, I would probably do so, too).