如何使用模板和数据库数据创建模板并生成pdf iText C# [英] How to create template and generate pdf using template and database data iText C#

查看:127
本文介绍了如何使用模板和数据库数据创建模板并生成pdf iText C#的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想使用iText7完成以下任务.

I want to do below task using iText7.

  1. 使用HTML或..创建模板(某些字段可以隐藏 根据用户输入)
  2. 用数据库数据填充模板
  3. 生成可访问的pdf
  1. create template using HTML or ..(some fields can be able to hide according to user input)
  2. Fill the template with the database data
  3. generate accessible pdf

我该怎么做?

推荐答案

据我了解,您想要一个HTML模板,您可以在其中基于用户输入以及来自数据库的数据填充数据.通常,在iText中可以做到这一点,但是您需要做很多工作,特别是如果您要为要生成的PDF提供模板(以及用于捕获数据的HTML表单的模板)时,尤其如此.

As far as I understand, you want to have an HTML template where you will fill in data based on user input as well as data coming from your database. This is possible in iText in general, however you would need to do a lot of work, especially if you want to have a template for the PDFs that you are going to generate (as well as the template for the HTML form for capturing data).

最好有一个工具来设计HTML表单,以及可以交互生成输出PDF的表单,甚至可以使用相同的资源,子表单,子模板等.技术人员唯一要做的就是将实际数据绑定到表单元素.模板将具有显示/隐藏元素或您可能想到的任何其他条件的逻辑.这样可以大大简化工作流程.

It would be nice to have a tool where we design the HTML form and the form with which the output PDF is going to be generated interactively and maybe even using the same resources, sub-forms, sub-templates etc. Then the only thing the technical person would do is to bind the actual data to the form elements. The template will have the logic to show/hid elements or any other conditions that you might come up with. It would simplify the workflow a lot.

iText正在开发一种名为Dito的产品,该产品已在印度班加罗尔的GIDS 2018中宣布,并进行了演示. Dito将完全按照您的要求以及我在上面描述的内容进行操作.您可以在此处找到演示文稿: http://www.developermarch.com/developersummit/downloadPDF /Dito.pdf

iText is working on a product called Dito which was announced in GIDS 2018 in Bangalore, India and a demo session was given. Dito is going to do exactly what you want and what I describe above. You can find the presentation here: http://www.developermarch.com/developersummit/downloadPDF/Dito.pdf

您还可以在此处找到文档工作流程: https://itextpdf .com/sites/default/files/attachments/LL_iText_Infographic_Flyer_A4-pdf.pdf

You can find also document workflow here: https://itextpdf.com/sites/default/files/attachments/LL_iText_Infographic_Flyer_A4-pdf.pdf

这篇关于如何使用模板和数据库数据创建模板并生成pdf iText C#的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆