Convert text file into pdf - python

I have a task to convert simple text file into pdf format. Also I need to add a header to that newly created pdf file.
The server which will have this text file and will convert it does not have any Microsoft Office document or other tools for conversion. One suggested to use python for that task since the server has it installed.
Could you please help me to start with conversion from text to pdf using python?
P.S. My system does not have pyPdf module and I failed to install it.
Thanks
Here is some update:
I run some program which at the end generate manifest. Manifest is a simple text file which looks like .csv file but columns are separated by white space. I ship this manifest to client. My current task is to ship to client additionally to this manifest another file which should have the same content and the header with the client name and be in PDF format.

I am all set now.
I figured out that my server already has pdf installed and the only thing I had to do was to call it. Sorry for confusion.
Ticket could be closed.

Related

How to convert docx to pdf in python dash

I am trying to deploy a python dash app to Heroku server. I perform some calculations based on user input and I create a docx report (I have a specific .docx template and I fill it with data each time). My problem is that before sending that report to the user, I want to convert it to pdf. I was already using for offline use, docx2pdf however I do not know if heroku has word embedded. Apart from that, I do not want to save the .docx and then convert it to pdf and then delete that .docx. I want to do all the conversions when the files are in memory, not stored.
Can you suggest me any other way to do that?
I tried docx2pdf without success, and I do not want this approach either because I have to save the file.
I tried another solution that I found, conver the docx to html and then to pdf with pdfkit, but the conversion from docx to html really messed up the document.
I also tried several other minor libraries without success.

Reading .nl file through browser in python

I am trying to read the characters in the screenshot below in python. It has to be done through the browser as this is the end an automation script and I can't download the file. The barcode doesn't matter, just the text.
The file is of ".nl" type
Is there any way that I could possibly do this?

Adding XML Source to xlsx file in python

I am trying to create a xlsx from a template exported from Microsoft dynamics NAV, so I can upload my file to the system.
I am able to recreate and fill the template using the library xlsxwriter, but unfortunately I have figured out that the template file also have an attached XML source code file(visible in the developer tab in Excel).
I can easily modify the XML file to match what I want, but I can't seem to find a way to add the XML source code to the xlsx file.
I have searched for "python adding xlsx xml source" but it doesn't seem to give me anything I can use.
Any help would be greatly appreciated.
Best regards
Martin
Xlsx file is basically a zip archive. Open it as archive and you'll probably be able to find the XML file and modify it. –
Mak Sim
yesterday

Python automatic script to convert EML file in Hebrew to PDF

Anyone have any suggestions on how to automate this problem using Thunderbird. I have an EML file that contains Hebrew and every conversion tool does not properly convert the Hebrew text correctly( it moves the sentence to be read left to right) except for Thunderbird. I have been looking at modules for Python such as autokey and dogtail but could use some advice on how to tackle this problem. If I open up the EML file with thunderbird and go to print I can save the file as pdf. I would like to automate this process.

how to read ppt file using python?

I want to get the content (text only) in a ppt file. How to do it?
(It likes that if I want to get content in a txt file, I just need to open and read. What do I need to do to get information from ppt files?)
By the way, I know there is a win32com in windows system. But now I am working on linux, is there any possible way?
I found this discussion over on Superuser:
Command line tool in Linux to Extract Text From Word, Excel, Powerpoint?
There are several reasonable answers listed there, including using LibreOffice to do this (and for .doc, .docx, .pptx, etc, etc.), and the Apache Tika Project (which appears to be the 5,000lb gorilla in this solution space).

Categories