简体   繁体   English

我如何在 django python 中使用 PDFKt

[英]How can i use PDFKt with django python

I need to process the uploaded PDF blank form and then extract the fields and then save that in database.我需要处理上传的 PDF 空白表单,然后提取字段,然后将其保存在数据库中。

i can use command line like我可以使用命令行

pdfkt myform.pdf dump_data_fields but i don't know how i can do in django pdfkt myform.pdf dump_data_fields但我不知道如何在 django 中做

any deas任何死亡

Its more of a Python thing.它更像是 Python 的东西。 You can use Python subprocess package.您可以使用 Python subprocess包。 It allows you to start subprocesses and interact with it using it's stdin, stdout, and stderr.它允许您启动子进程并使用它的 stdin、stdout 和 stderr 与之交互。 Here is an example of how you can invoke your command in Python (or Django):以下是如何在 Python(或 Django)中调用命令的示例:

from subprocess import check_output

command = 'pdfkt %s dump_data_fields' % path
output = check_output(command, shell=True)
# do some processing here on output

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

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