简体   繁体   English

将文本文件转换为pdf

[英]Convert text file into pdf

I have a task to convert simple text file into pdf format. 我的任务是将简单的文本文件转换为pdf格式。 Also I need to add a header to that newly created pdf file. 另外,我需要向新创建的pdf文件添加标头。 The server which will have this text file and will convert it does not have any Microsoft Office document or other tools for conversion. 具有该文本文件并将其转换的服务器没有任何Microsoft Office文档或其他转换工具。 One suggested to use python for that task since the server has it installed. 由于服务器已安装,因此建议使用python执行该任务。 Could you please help me to start with conversion from text to pdf using python? 您能帮我开始使用python从文本转换为pdf吗? PS My system does not have pyPdf module and I failed to install it. PS我的系统没有pyPdf模块,我无法安装它。

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. 清单是一个简单的文本文件,看起来像.csv文件,但列之间用空格隔开。 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. 我当前的任务是将另外一个文件发送给客户端到此清单,该文件应具有相同的内容和带有客户端名称的标头,并且应为PDF格式。

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. 我发现我的服务器已经安装了pdf,唯一要做的就是调用它。 Sorry for confusion. 抱歉造成混乱。 Ticket could be closed. 门票可能关闭。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM