简体   繁体   English

如何从数据库中获取信息并自动填充PDF表单?

[英]How can I take information from a database and auto-populate a PDF form?

I'm working with a group and we are writing software in Java We need to take information and store it in a database, and then use that database to auto-populate a PDF Form. 我正在与一个小组一起工作,我们正在用Java编写软件。我们需要获取信息并将其存储在数据库中,然后使用该数据库自动填充PDF表单。

I've seen FDF Toolkit and PDFBox. 我看过FDF工具包和PDFBox。 FDF Toolkit doesn't seem like it'll do what we need. FDF Toolkit似乎无法满足我们的需求。 It just creates FDF Documents for online use, unless I've got that wrong. 除非我错了,否则它只会创建供在线使用的FDF文档。 We need to save this information into the actual PDF inside our program. 我们需要将该信息保存到程序内部的实际PDF中。

PDFBox seems like the tool to do it, but I'm not sure exactly how to use it to just manipulate form data instead of the entire PDF. PDFBox似乎是执行此操作的工具,但我不确定确切如何使用它来操作表单数据而不是整个PDF。

I've also read that Form data is stored in an XML file and that we can manipulate the XML file and then just merge the data into a new form. 我还读到Form数据存储在XML文件中,我们可以操纵XML文件,然后将数据合并成新的表单。

How can I take information from a database and auto-populate a PDF form? 如何从数据库中获取信息并自动填充PDF表单? Is there another way to do it outside of writing our own program? 除了编写我们自己的程序之外,还有另一种方法吗?

You could use iText ! 您可以使用iText! Here's the official examples page: examples page and especially look at this example : here : In that example they are showing the case of getting information about some countries from a database and outputing them to a pdf file! 这是官方的示例页面: 示例页面 ,尤其是下面的示例: 这里 :在该示例中,它们显示了从数据库获取有关某些国家的信息并将其输出到pdf文件的情况。 (pretty simple example though) I think that either way you should write your own program to get to your purpose! (不过,这是一个非常简单的示例)我认为无论哪种方式,您都应该编写自己的程序以实现自己的目标! Hope it'll help! 希望对您有所帮助!

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

相关问题 如何根据用户选择使用数据库中的数据自动填充字段 - How to auto-populate fields with data from a DB based on user selection 如何用mySQL数据库中的信息填充jcombobox? - How do I populate a jcombobox with information from a mySQL database? 如何从数据库中获取信息并在选择中使用它 - How to take information from a database and use it in a select 如何使用 Hibernate3-Maven-Plugin 在创建时自动填充表 - How to auto-populate a table upon creation using Hibernate3-Maven-Plugin 如何从数据库中获取电子邮件和密码? 我无法在Spring Security中验证用户 - How can i take email and password from database? I can't validate users in Spring security 从数据库中读取 java.sql.Date 时如何考虑时区? - How can I take into account the TimeZone of java.sql.Date when I read it from database? 如何使用 Firebase 实时数据库中的关联节点名称列表填充“微调器”? - How can I populate the 'Spinner' with a list of associated node names from the Firebase Realtime Database? 如何使用Spring MVC从表单中填充两个bean? - How can I populate two beans from my form with Spring MVC? 如何使用数据库中的值通过动态数组或 ArrayList f 填充 JTable - How can i populate a JTable via a dynamic array or ArrayList fwith values from a database 从javaFX中的数据库生成PDF调用信息 - generate PDF calling information from database in javaFX
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM