The invoice data from my hledger file and a HTML template together are generated to a HTML invoice. The HTML invoice together with a CSS file are processed to PDF using WeasyPrint [1].
ledger-cli is great, but I'd strongly encourage using an older 2.6 release. The 3.x releases don't forecast accurately for me and the 3.x code is (a complex and disturbingly unreadable) complete rewrite of 2.x.