Class Security
Class Security
Namespace: Aspose.Pdf.Plugins
Assembly: Aspose.PDF.dll
表示 Aspose.Pdf.Plugins.Security 插件。
public sealed class Security : IPlugin
继承
实现
继承成员
object.GetType(), object.ToString(), object.Equals(object?), object.Equals(object?, object?), object.ReferenceEquals(object?, object?), object.GetHashCode()
示例
该示例演示如何加密 PDF 文档。
// 创建 Security
var plugin = new Security();
// 创建 EncryptionOptions 对象以设置指令
var opt = new EncryptionOptions("123456", "qwerty", DocumentPrivilege.ForbidAll));
// 添加输入文件路径
opt.AddInput(new FileDataSource(inputPath));
// 设置输出文件路径
opt.AddOutput(new FileDataSource(outputPath));
// 执行处理
plugin.Process(opt);
该示例演示如何解密 PDF 文档。
// 创建 Security
var plugin = new Security();
// 创建 DecryptionOptions 对象以设置指令
var opt = new DecryptionOptions("123456"));
// 添加输入文件路径
opt.AddInput(new FileDataSource(inputPath));
// 设置输出文件路径
opt.AddOutput(new FileDataSource(outputPath));
// 执行处理
plugin.Process(opt);
构造函数
Security()
public Security()
方法
Process(IPluginOptions)
使用指定参数启动 Aspose.Pdf.Plugins.Security 处理。
public ResultContainer Process(IPluginOptions options)
参数
options
IPluginOptions
一个包含 Aspose.Pdf.Plugins.Security 指令的选项对象。
返回
一个包含操作结果的 ResultContainer 对象。