How to create template and generate pdf using template and database data iText C#

随声附和 提交于 2019-12-04 06:53:41

问题


I want to do below task using iText7.

  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

How can I do this?


回答1:


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).

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 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

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



来源:https://stackoverflow.com/questions/50921762/how-to-create-template-and-generate-pdf-using-template-and-database-data-itext-c

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!