Ive got some stuff that i think is similar to what you are trying where i have an excel file template and use python to read from the database and populate cells in excel and then save a pdf.
There are a couple different options for python libraries - openpyxl, xlwings, or pywin32.
It is annoying and goofy, but works. Excel can be very flexible with getting everything sized just right for what your final output/pdf should look like.