Here are a few options:
Select your programming language on the right: https://github.com/search?utf8=✓&q=pdf+generator
https://wkhtmltopdf.org/. wkhtmltopdf renders a pdf with real text, it’s not an image. It’s language agnostic (because it’s a command line tool). Your software would produce an HTML page and wkhtmltopdf essentially prints the page to pdf.