java 如何使用java将PDF表单(用户填写并提交)数据保存到数据库中

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/11647609/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-10-31 05:54:50  来源:igfitidea点击:

How to save PDF form(user fills and submit) data into Database using java

javapdf

提问by user1323709

Here is my scenario,

这是我的场景,

"user opens the PDF in web browser and fills required data and clicks the submit button",

“用户在网络浏览器中打开 PDF 并填写所需数据并单击提交按钮”,

How do i save the above PDF data into database using java technology,

我如何使用java技术将上述PDF数据保存到数据库中,

i tried with iText lib and servlets concepts, unable to finish the task,

我尝试使用 iText lib 和 servlets 概念,但无法完成任务,

thanks all, looking for help

谢谢大家,寻求帮助

回答by Jean Logeart

You might to have a look at the Apache PDFBoxlibrary.

您可能会查看Apache PDFBox库。

回答by BZ1

You can create a PDF that submits to a URL. At the URL, you can run a server-side script (PHP or ASP.NET) that processes the submitted form contents. The server-side script can save the form data to your database.

您可以创建提交到 URL 的 PDF。在 URL 处,您可以运行处理提交的表单内容的服务器端脚本(PHP 或 ASP.NET)。服务器端脚本可以将表单数据保存到您的数据库中。

回答by cemerick

It's easy to extract form data from PDF documents using PDFTextStream. There is some sample code right on that first landing page to get you started; you can also dig into the details of form data extraction with PDFTextStreamwhen you're ready.

使用PDFTextStream从 PDF 文档中提取表单数据很容易。在第一个登录页面上有一些示例代码可以帮助您入门;准备好后,您还可以深入了解使用 PDFTextStream 提取表单数据的详细信息

(Disclosure: I am employed by Snowtide, the makers of PDFTextStream. I hope this pointer is helpful in any case.)

(披露:我受雇于 PDFTextStream 的制造商 Snowtide。我希望这个指针在任何情况下都有帮助。)

回答by Steven

PDF Form submit button have special function, that support submit via http, and need write java code to parse the submitted form and save the data to database. you can have a look this example,http://rubypdf.appspot.com/demo.pdf

PDF表单提交按钮有特殊功能,支持http提交,需要编写java代码解析提交的表单并将数据保存到数据库中。你可以看看这个例子,http://rubypdf.appspot.com/demo.pdf