2024-10-01 07:44:18 发布
网友
我正在pythondjango中做一个项目,我想知道是否有任何内置库或类似的东西,可以将文本转换成pdf格式。类似于pyTeaser的东西,用于将图像转换为文本
提前谢谢
有几种选择:
另请看一下:
希望有帮助。在
下载并尝试this。作者写道:
PyText2Pdf makes a 7-bit clean PDF file from any input file.It reads from a named file, and writes the PDF file to a file specified by the user, otherwise to a file with '.pdf' appended to the input file.
PyText2Pdf makes a 7-bit clean PDF file from any input file.
It reads from a named file, and writes the PDF file to a file specified by the user, otherwise to a file with '.pdf' appended to the input file.
您可以按以下说明运行它:
text2pdf.py rfc_3917.txt -S "Netflow RFC" -A "Quittek, et al." -K netflow,rfc,networking,ipfix -R "[Page\s+\d+]"
但请查看脚本内部以了解更多详细信息。在
指向其在Django中用法的链接是here,但部分过时,因为使用了旧的脚本。我在这里提供的链接是更新的。在
我已经使用django-webodt将OpenOffice模板(.odt)动态转换为PDF填充占位符的数据库模型。在
在测试.odt可以是。。。在
Hello {{ first_name }}
import webodt template = webodt.ODFTemplate('test.odt') context = dict(first_name="Mary") document = template.render(Context(context)) from webodt.converters import converter conv = converter() pdf = conv.convert(document, format='pdf')
有几种选择:
另请看一下:
希望有帮助。在
下载并尝试this。作者写道:
您可以按以下说明运行它:
但请查看脚本内部以了解更多详细信息。在
指向其在Django中用法的链接是here,但部分过时,因为使用了旧的脚本。我在这里提供的链接是更新的。在
我已经使用django-webodt将OpenOffice模板(.odt)动态转换为PDF填充占位符的数据库模型。在
在测试.odt可以是。。。在
相关问题 更多 >
编程相关推荐