Python utility to convert a text file to pdf?

I want advice. Thank you.
I am looking for a python utility to convert a text file to a PDF that contains the text.
It would be nice to control paper size, margins, font, font size, top, bottom, etc.
It would be nice to be able to insert image files.
Thank you.

1 Like

Hello Hankivy,

do you want to re-invent the wheel ?! This idea is not bad - but in Linux and Unix there are already several possibilities to do this in terminal :

Here is an overview of these possibilities - some commands might been have written in a script language - maybe you can look after source code for these commands - then port this to Python - in case it is not already written in Python :

Hi Hank, or do you prefer Henry?

Have you checked the links here?

You should also check out here:

Thank you. I have checked out the links you gave me.

I wrote a more powerful utility in PERL. See the project text2pdf2 in Github.
But I had a need to make it better. Given the overwhelming popularity of Python, it was likely someone had beaten me to a better utility. If so, I would have become a Python convert.

Again, thank you.

Hank Ivy