从表单数据创建PDF并保存 [英] Create PDF from form data and save it

查看:42
本文介绍了从表单数据创建PDF并保存的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用可编辑的pdf文件(由 Nitro PDF软件创建)我的应用程序.这些pdf文件具有很多可编辑的字段(例如文本框)和一个按钮(例如提交).

I am using editable pdf files (created by Nitro PDF Software) in my application. These pdf files have a lot of editable fields (like textboxes) and one button (like submit).

每当用户打开该pdf文件,输入文本并单击提交"按钮时,他们就会重定向到aspx页面.

Whenever a user opens that pdf file, enters the text, and clicks the submit button they get redirected to an aspx page.

如何获取发布到此页面的所有静态和动态值,并使用输入的数据创建另一个pdf文件?以及如何保存创建的pdf文件?

How do I get all the static and dynamic values that are posted to this page, and create another pdf file with the entered data? And how do I save the created pdf file?

推荐答案

如何获取发布到此页面的所有静态和动态值?

您可以在从html控件中检索其他任何值时检索它们,例如:

You can retreive them as you retrieve any other value from an html control, for example:

string MyVal = Request.Form["FieldName"];

并使用输入的数据创建另一个pdf文件?

您可以在此处使用自己选择的PDF库(iText.Net,Nitro PDF,Amyuni PDF Creator.Net ),加载您的PDF表单,将值设置为每个字段,根据需要展平文件并保存.这部分的代码取决于所使用的库,但是通常它们都有很好的文档说明,因此您应该可以轻松找到示例代码.

Here you can use a PDF library of your choice ( iText.Net, Nitro PDF, Amyuni PDF Creator.Net ), load your PDF form, set the values to each field, flatten your file if needed, and save. The code for this part depends on the library being used, but they are usally well documented so you should be able to find sample code easily.

这篇关于从表单数据创建PDF并保存的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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