使用.net仅编辑一次PDF [英] Editing PDF only once using .net

查看:91
本文介绍了使用.net仅编辑一次PDF的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用iTextSharp从ASP.NET生成PDF文件,并且能够对其进行编辑.
当用户从应用程序中打开pdf进行编辑和保存时,我需要在使用.net代码对它进行一次编辑后将其禁用.
我怎样才能做到这一点?如果您需要更多信息,我会提供...

在此先感谢

I am generating a PDF file from ASP.NET using iTextSharp and I''m able to edit it.
When the user opens the pdf from the application to edit and save it, I need to disable the edit option after it has been edited once using the .net code.
How can I do this? If you need more info, I''ll provide it...

Thanks in advance

推荐答案

您如何第一次允许编辑?只是下次不允许.
How are you allowing the editing the first time? Just don''t allow it the next time.


可以限制用户多次编辑同一pdf的唯一方法是,如果您-在应用程序中-跟踪给定的pdf是否已经被编辑,并且如果用户试图进行编辑,则不允许进一步的编辑.

无法查看" pdf并告知它已被编辑. (但是您可以出于这种目的使用文件只读标志.)

但是,另一个:您可以将原始" pdf保留在给定的文件夹中,一旦对其进行了编辑,则将其移至另一个文件夹.这样,您可以-从文件的位置-允许或禁止编辑.

两种方式:您(或您的程序)必须提供启用/禁用编辑功能的逻辑.
The only way that you can restrict the user from editing the same pdf more than once is if you - in your application - keeps track of whether or not a given pdf has already been edited and disallows further editing if the user tries to do that.

It''s not possible to "look at" the pdf and tell that it has already been edited. (But you COULD perhaps use the files read-only flag for such a purpose).

Another though: You can keep the "original" pdf''s in a given folder, and once it has been edited, you move it to another folder. That way you can - from the location of the file - allow or disallow editing.

Either way: YOU (or rather your program) have to supply the logic for enabling/disabling the editing feature.


这篇关于使用.net仅编辑一次PDF的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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