从iframe检索PDF [英] Retrieve PDF from iframe

查看:165
本文介绍了从iframe检索PDF的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

是否可以从iframe检索PDF并将其提交回服务器?

Is it possible to retrieve a PDF from an iframe and submit it back to the server?

我的用例是向用户显示PDF表单,并让他们在填写表单后提交表单.我还没有发现任何迹象表明这是可能的,但目前我仍然充满希望.

My use case is to display a PDF form to the user, and let them submit the form after filling it out. I haven't found anything indicating this is possible, but I'm remaining hopeful for the moment.

推荐答案

您可以在生成PDF时在其内部添加一个提交按钮,并以与处理HTML相同的方式来处理来自PDF表单的数据.表格.

You can add a submit button inside the PDF itself while generating it, and treat the data comming from your PDF form in the same way you would deal with an HTML form.

为实现此目的,您将需要在PDF表单中添加按钮注释,并向其添加提交表单"操作.请参阅Adobe的 PDF参考文档的第8章-交互式表单./a>了解更多信息.

In order to achieve this, you will need to add a button annotation to your PDF form, and attach a "submit form" action to it. See Chapter 8 - Interactive Forms of the PDF Reference Document from Adobe for more details.

然后可以创建一个asp.net页面,以处理来自PDF表单的输入.请注意,可以在asp.net Request对象中使用PDF表单的字段名称来收集数据.

You can create then an asp.net page that processes the input from the PDF form. Note that the field names of a PDF form can be used in asp.net Request object to collect the data.

如果要提交整个文件,可以通过在需要添加到PDF文件的提交表单"操作中设置标记来进行,但是一般不建议这样做将消耗您服务器的更多带宽.

If you want to submit the whole file instead, you can do so by setting a flag in the "submit-form" action that you need to add to your PDF file, but I do not recommend doing this in general since it will consume more bandwidth from your server.

这篇关于从iframe检索PDF的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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