I have some simple text files. I want to print them using Python and the module cups. This cups python module can't handle .odt or .docx.
Quote:
>>> conn.printFile('EPSON-L350-Series', '/home/pedro/getEmailtexts/stragglers/17BElate.odt', 'test', {})
Traceback (most recent call last):
File "<pyshell#19>", line 1, in <module>
conn.printFile('EPSON-L350-Series', '/home/pedro/getEmailtexts/stragglers/17BElate.odt', 'test', {})
cups.IPPError: (1034, 'Unsupported document-format "application/vnd.oasis.opendocument.text".')
|
If I print the text file, it prints right along the top edge of the page and almost on the right edge of the page.
This prints the pdf in Python:
Quote:
conn.printFile('EPSON-L350-Series', '/home/pedro/getEmailtexts/stragglers/17BElate.pdf', 'test', {})
|
If I print as pdf in Python, it looks ok. So I need to convert 300+ text files to pdf.
I have the python module text2pdf, but I can't find docs to show the usage. However, in bash text2pdf works.
Quote:
pedro@pedro-newssd:~/getEmailtexts/stragglers$ text2pdf -o 17BElate.pdf 17BElate.txt
|
So I just need to batch this command for bash and convert the whole directory contents.
Any tips please??