如何修改和更新pdf文件? [英] How to edit and update the pdf file?

查看:315
本文介绍了如何修改和更新pdf文件?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用asp.net开发Web应用程序。

I am working on a web application using asp.net.

要求之一要求我打开包含表单字段的给定pdf文件,填写字段,如选中复选框,从选择输入中选择值并输入文本在文本框等中。

One of requirements demands that I open a given pdf file containing form fields, fill the fields like checking the check boxes, selecting the values from the select inputs and entering the text in text boxes etc.

设置字段后,我需要将其提交给服务器并将其保存为新的pdf文件或更新相同的pdf文件

Once the fields are set then I need to submit it to server and save this as a new pdf file or update the same pdf file.

我在pdf中没有提交按钮。我需要使用pdf文件外的按钮向服务器提交详细信息。

I don't have a submit button in the pdf itself. I need to submit the details to server using a button outside the pdf file.

推荐答案

当您在服务器上有文件时你将它提供给客户端,有两个文件实例:一个在服务器上,一个在客户端上。

When you have a file on a server and you serve it to a client, there are two instances of the file: one on the server and one on the client.

最终用户可以填写表格客户端,但如果您希望他将输入的数据提交给服务器,则需要PDF上的按钮。这在此解释:编辑pdf嵌入在浏览器中并将pdf直接保存到服务器

The end user can fill out the form on the client, but will need a button on the PDF if you want him to submit the data he entered to the server. This is explained here: Edit pdf embedded in the browser and save the pdf directly to server

您需要在外部按下PDF按钮不可能的情况:它需要在PDF查看器和浏览器之间建立通信。这只能在非常特定的环境中使用:它需要Adobe Reader插件,它不能在Mac上运行。另请参见 PDF hostContainer回调

Your requirement to have a button outside the PDF is in most cases impossible: it requires establishing communication between the PDF viewer and the browser. This is only possible in a very specific environment: it requires the Adobe Reader plug-in and it won't ever work on Mac. See also PDF hostContainer callback

您需要重新考虑在PDF外部使用按钮的要求!我一直致力于一个类似的项目,其中提交按钮已即时添加到表单中。该按钮仅在客户端上的PDF上可见。客户端使用该按钮提交数据。

You need to reconsider the requirement of having a button outside the PDF! I've been working on a similar project where the submit button was added to the form on-the-fly. The button was only visible on the PDF on the client. The client used that button to submit the data.

提交数据后(参见编辑嵌入浏览器的pdf并将pdf直接保存到服务器以找出以哪种形式数据可以传输),你可以填写服务器端的表格。这在此解释:

Once the data is submitted (see Edit pdf embedded in the browser and save the pdf directly to server to find out in which form the data can be transmitted), you can fill out the form on the server-side. This is explained here:

服务器上的表单是您的模板。我假设这个模板将被提供给许多不同的人。如果是这样,那么您不希望用前一个用户填写的表单替换该模板!(此代码会导致一些严重的隐私问题。)

The form on your server is your template. I assume that this template will be served to many different people. If that is true, then you do not want to replace that template with a form that is filled out by the previous user! (This code cause some serious privacy issues.)

如果您确实要更新服务器上存在的PDF(而不是创建新副本),您可能还想阅读此问题的答案:如何在不创建新PDF的情况下更新PDF?

If you really want to update the PDF that exists on the server (instead of creating a new copy), you might also want to read the answer to this question: How to update a PDF without creating a new PDF?

这篇关于如何修改和更新pdf文件?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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