简体   繁体   English

如何在浏览器中显示PDF提交的表单数据

[英]how to display submitted form data from PDF in browser

I've generated a PDF using iText with form fields and a submit button that POSTS the data as FDF. 我已经使用iText和表单字段以及一个将数据以FDF形式发布的提交按钮生成了PDF。 I dedcided to use POST instead of GET because of the size of data that needs to be submitted. 我决定使用POST而不是GET,因为需要提交的数据量很大。 I would like the client to open this PDF in the standalone Acrobat Reader application. 我希望客户端在独立的Acrobat Reader应用程序中打开此PDF。 In the servlet, I can read in the streamed data. 在servlet中,我可以读取流式数据。 My problem now is, how would I display the streamed data on a webpage? 我现在的问题是,如何在网页上显示流式数据?

I searched SO and it looks like a similar question was asked here: Sending 'success' response back to Acrobat Reader from java servlet 我搜索了SO,看起来好像在这里问了类似的问题: 从Java servlet向Acrobat Reader发送“成功”响应

Reading Bruno's answer, it looks like my only option is #2 but unsure of how I would stream the form's data to the server, and then back a webpage to display. 阅读Bruno的答案,看来我唯一的选择是#2,但不确定如何将表单数据流式传输到服务器,然后返回要显示的网页。

Thanks for the any help, input or suggestions! 感谢您的任何帮助,意见或建议!

Thanks to the comments, we were able to establish that you are asking two simple things. 多亏了这些评论,我们才能够确定您在问两个简单的问题。

  1. You are trying to merge an FDF file with its original form. 您正在尝试将FDF文件与其原始格式合并。 This is done using the FdfReader class in combination with "traditional" form filling: Write FDF to PDF using iTextsharp 这是通过结合使用FdfReader类和“传统”表单来完成的: 使用iTextsharp将FDF写入PDF
  2. You want to return the result to the end-user and have him open it in Adobe Reader: Read PDF file and offer it as download with iText 您想将结果返回给最终用户,并让他在Adobe Reader中打开它: 阅读PDF文件并通过iText下载提供。

I realize that this answer doesn't conform with the rules on StackOverflow, as it is a "link-only" answer. 我意识到此答案不符合StackOverflow上的规则,因为它是“仅链接”的答案。 My other options would have been: marking the question as duplicate (but then I'd only be able to pick one of the two answers that need to be combined), or adding my answer as a comment, but then it would look as if the question isn't answered. 我的其他选择是:将问题标记为重复(但是我只能选择两个需要合并的答案之一),或者将我的答案添加为注释,但看起来好像问题没有得到回答。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM