生成并保存为PDF文件 [英] Generate and save a PDF file

查看:208
本文介绍了生成并保存为PDF文件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在我的应用程序中使用可编辑的PDF文件(由硝基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控件检索任何其他值,您可以retreive他们,例如:

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,硝基PDF, Amyuni PDF Creator.Net ),加载PDF格式,值设置为每个字段,如果需要,扁平化您的文件,并保存。在code这部分依赖于库被使用,但他们usally有据可查的,所以你应该能够很容易地找到样本code。

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天全站免登陆