我如何使用PDFKt與django python

[英]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

任何deas

1 个解决方案

#1


0  

Its more of a Python thing. You can use Python subprocess package. It allows you to start subprocesses and interact with it using it's stdin, stdout, and stderr. Here is an example of how you can invoke your command in Python (or Django):

它更像是一個Python的東西。您可以使用Python子進程包。它允許您啟動子進程並使用它的stdin,stdout和stderr與它進行交互。以下是如何在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

注意!

本站翻译的文章,版权归属于本站,未经许可禁止转摘,转摘请注明本文地址:https://www.itdaan.com/blog/2012/11/12/6bddfd3343cbe5f4ffd352cb7328049.html



 
粤ICP备14056181号  © 2014-2021 ITdaan.com