有什么方法可以将PDF文件在c#中设置为只读? [英] Is there any way to make PDF file as readonly in c#?

查看:204
本文介绍了有什么方法可以将PDF文件在c#中设置为只读?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用iTextSharp dll编辑pdf文件中的字段.我将文本添加到pdf文件中,然后保存该文件.但是问题是当我打开pdf文件时
它给出了以下问题.

当我单击pdf文件上的任何文本时,文本将上下移动.


我们如何解决这个问题.
有什么解决方法.

I am editing the fields inside pdf file by using the iTextSharp dll. I am adding text to the pdf file and then saving that file. But the problem is when i open the pdf file
it is giving the following problem.

When i click on any text on the pdf file text is moving up and down.


How could we solve this issue.
Is there any solution.

推荐答案

我知道可以通过设置用户密码权限来只读PDF.请看下面的代码:
I know that PDF can be readonly by setting user password permissions.look at below code:
doc.Security.Permissions = PdfPermissionsFlags.Print | PdfPermissionsFlags.CopyContent;


但是我不知道itexsharp是否可以实现,因为我已经使用了商业PDF组件.


but I do not know whether it can be realized by itexsharp since I have used a commercial PDF component.


这篇关于有什么方法可以将PDF文件在c#中设置为只读?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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