Dec-16-2018, 07:57 AM
I want to covert some (very simple) text files to pdf. To that end, I imported the text2pdf module. However, I cannot find any documentation on the usage. So I tried things like:
pdf = text2pdf.pdf(file)
pdf = text2pdf.write(file)
pdf = text2pdf.convert(file)
Can anyone point me at documentation for text2pdf.
The reason for this is, I want to use python to print the textfiles. I imported cups and printed a text file:
This works great, but there is no kind of formatting. The text is written right along the top edge of the page and very close to the right hand edge.
I tried to print the text as a Libre Office .odt file or a .docx file, but cups can't handle that. When I save the text file as pdf, cups prints it nicely.
Therefore, I would like to batch convert 300+ text files to pdf.
pdf = text2pdf.pdf(file)
pdf = text2pdf.write(file)
pdf = text2pdf.convert(file)
Can anyone point me at documentation for text2pdf.
The reason for this is, I want to use python to print the textfiles. I imported cups and printed a text file:
Quote:conn.printFile('EPSON-L350-Series', '/home/pedro/getEmailtexts/stragglers/17BElate.pdf', 'test', {})
This works great, but there is no kind of formatting. The text is written right along the top edge of the page and very close to the right hand edge.
I tried to print the text as a Libre Office .odt file or a .docx file, but cups can't handle that. When I save the text file as pdf, cups prints it nicely.
Therefore, I would like to batch convert 300+ text files to pdf.