Documentize Namespace 的子部分
Class AddTimestampOptions
信息
表示 Documentize.Timestamp 插件的添加时间戳选项。
[Obsolete("The class will be deleted soon. Please use SignOptions class.")]
public class AddTimestampOptions : PluginBaseOptions, IPluginOptions
继承
object ←
PluginBaseOptions ←
AddTimestampOptions
实现
继承的成员
- PluginBaseOptions.AddInput(IData),
- PluginBaseOptions.AddOutput(IData),
- PluginBaseOptions.Inputs,
- PluginBaseOptions.Outputs,
- PluginBaseOptions.CloseInputStreams,
- PluginBaseOptions.CloseOutputStreams,
- object.GetType(),
- object.MemberwiseClone(),
- object.ToString(),
- object.Equals(object?),
- object.Equals(object?, object?),
- object.ReferenceEquals(object?, object?),
- object.GetHashCode()
构造函数
AddTimestampOptions(Stream, string, string, string)
使用默认选项初始化 Documentize.AddTimestampOptions 对象的新实例。
public AddTimestampOptions(Stream pfx, string password, string serverUrl, string serverBasicAuthCredentials = "")
参数
pfx Stream: pfx 文件的路径。password string: pfx 文件的密码。serverUrl string: 时间戳服务器的 URL。serverBasicAuthCredentials string: 基本身份验证凭据,用户名和密码合并为字符串 “username:password”。(可选)。
AddTimestampOptions(string, string, string, string)
使用默认选项初始化 Documentize.AddTimestampOptions 对象的新实例。
public AddTimestampOptions(string pfx, string password, string serverUrl, string serverBasicAuthCredentials = "")
参数
pfx string: pfx 文件的路径。password string: pfx 文件的密码。serverUrl string: 时间戳服务器的 URL。serverBasicAuthCredentials string: 基本身份验证凭据,用户名和密码合并为字符串 “username:password”。(可选).
Class ChatCompletion
public class ChatCompletion
继承
object ←
ChatCompletion
继承成员
构造函数
ChatCompletion()
属性
Choices
聊天完成的选项列表。如果 n 大于 1,则可能有多个选项。
[JsonProperty("choices")]
public List<choice> Choices { get; set; }
属性值
List<Choice>
Created
聊天完成创建时的 Unix 时间戳(秒)。
[JsonProperty("created")]
public long Created { get; set; }
属性值
long
Id
聊天完成的唯一标识符。
[JsonProperty("id")]
public string Id { get; set; }
属性值
string
Model
用于聊天完成的模型。
[JsonProperty("model")]
public string Model { get; set; }
属性值
string
Object
对象类型,始终为 chat.completion。
[JsonProperty("object")]
public string Object { get; set; }
属性值
string
SystemFingerprint
此指纹代表模型运行时的后端配置。
[JsonProperty("system_fingerprint")]
public string SystemFingerprint { get; set; }
属性值
string
Usage
完成请求的使用统计信息。
[JsonProperty("usage")]
public Usage Usage { get; set; }
属性值
Usage
Class ChatGptConsts
public static class ChatGptConsts
继承
object ←
ChatGptConsts
继承成员
字段
ApiUrl
public static string ApiUrl
字段值
string
ModelName
public static string ModelName
字段值
string
SystemRole
public static string SystemRole
字段值
string
SystemRoleDescription
public static string SystemRoleDescription
字段值
string
UserRole
public static string UserRole
字段值
string
Class ChatGptRequestOptions
信息
表示 Documentize.PdfManager 插件的选项。
public class ChatGptRequestOptions : PluginBaseOptions, IPluginOptions
继承
object ←
PluginBaseOptions ←
ChatGptRequestOptions
实现
继承成员
- PluginBaseOptions.AddInput(IData),
- PluginBaseOptions.AddOutput(IData),
- PluginBaseOptions.Inputs,
- PluginBaseOptions.Outputs,
- PluginBaseOptions.CloseInputStreams,
- PluginBaseOptions.CloseOutputStreams,
- object.GetType(),
- object.MemberwiseClone(),
- object.ToString(),
- object.Equals(object?),
- object.Equals(object?, object?),
- object.ReferenceEquals(object?, object?),
- object.GetHashCode()
构造函数
ChatGptRequestOptions()
使用默认选项初始化 Documentize.ChatGptRequestOptions 对象的新实例。
public ChatGptRequestOptions()
ChatGptRequestOptions(string, string, string, string)
使用指定选项初始化 Documentize.ChatGptRequestOptions 对象的新实例。
public ChatGptRequestOptions(string apiKey, string model, string apiUrl, string query)
参数
apiKey string: 访问 ChatGPT API 的密钥。model string: ChatGPT 模型的名称。默认模型为:gpt-3.5-turbo-1106。apiUrl string: ChatGPT API 的 URL。默认 URL 为:https://api.openai.com/v1/chat/completions。query string: 发送给 ChatGPT 的请求字符串。
属性
ApiKey
获取或设置访问 ChatGPT API 的密钥。
public string ApiKey { get; set; }
属性值
string
ApiUrl
获取或设置 ChatGPT API 的 URL。
public string ApiUrl { get; set; }
属性值
string
CancellationToken
取消令牌。
public CancellationToken CancellationToken { get; set; }
属性值
CancellationToken
MaxTokens
响应中最大 token 数。默认值为 null,表示无限制。
public int? MaxTokens { get; set; }
属性值
int?
Messages
获取或设置 Documentize.Message 对象的集合。
public List<message> Messages { get; set; }
属性值
List<Message>
备注
向选项中添加多个消息时,集合中的顺序如下:
- 第一个消息(如果有)来自
options.Query,其前置消息内容为 “You are a helpful assistant.”,角色为 “system”。 - 接着(如果有)添加
options.Messages 集合中的消息。 - 来自文件源的消息(如果有)最后添加,每个文档对应一个角色为 “user” 的消息对象。
如果未提供任何消息,将抛出 ArgumentException。
Model
设置或获取要使用的模型 ID。
public string Model { get; set; }
属性值
string
NumberOfChoices
为每条输入消息生成的聊天完成选项数量。
public int NumberOfChoices { get; set; }
属性值
int
Query
获取或设置发送给 ChatGPT 的请求字符串。若非空,则此字符串为集合中的第一条消息,随请求一起发送。
public string Query { get; set; }
属性值
string
Temperature
采样温度,取值范围 0 到 2。值越高(例如 0.8)输出越随机,值越低(例如 0.2)输出越集中且确定。默认值为 1。
public double Temperature { get; set; }
属性值
double
Class Choice
Inheritance
object ←
Choice
Inherited Members
Constructors
Choice()
Properties
FinishReason
模型停止生成标记的原因。
如果模型到达自然停止点或提供的停止序列,则会停止;如果在请求中指定的最大标记数已达到,也会停止。
[JsonProperty("finish_reason")]
public string FinishReason { get; set; }
Property Value
string
Index
在选择列表中的索引。
[JsonProperty("index")]
public int Index { get; set; }
Property Value
int
Message
模型生成的聊天完成消息。
[JsonProperty("message")]
public Message Message { get; set; }
Property Value
Message
Class CompressOptions
信息
表示 Documentize.PdfManager 组件的压缩选项。
public sealed class CompressOptions : PluginBaseOptions, IPluginOptions
继承
object ←
PluginBaseOptions ←
CompressOptions
实现
继承成员
- PluginBaseOptions.AddInput(IData),
- PluginBaseOptions.AddOutput(IData),
- PluginBaseOptions.Inputs,
- PluginBaseOptions.Outputs,
- PluginBaseOptions.CloseInputStreams,
- PluginBaseOptions.CloseOutputStreams,
- object.GetType(),
- object.ToString(),
- object.Equals(object?),
- object.Equals(object?, object?),
- object.ReferenceEquals(object?, object?),
- object.GetHashCode()
构造函数
CompressOptions()
使用默认选项初始化 Documentize.CompressOptions 对象的新实例。
Class DecryptionOptions
信息
表示 Documentize.Security 插件的解密选项。
public class DecryptionOptions : PluginBaseOptions, IPluginOptions
继承
object ←
PluginBaseOptions ←
DecryptionOptions
实现
继承成员
- PluginBaseOptions.AddInput(IDataSource),
- PluginBaseOptions.AddOutput(IDataSource),
- PluginBaseOptions.Inputs,
- PluginBaseOptions.Outputs,
- PluginBaseOptions.CloseInputStreams,
- PluginBaseOptions.CloseOutputStreams,
- object.GetType(),
- object.MemberwiseClone(),
- object.ToString(),
- object.Equals(object?),
- object.Equals(object?, object?),
- object.ReferenceEquals(object?, object?),
- object.GetHashCode()
构造函数
DecryptionOptions(string)
使用默认选项初始化 Documentize.DecryptionOptions 对象的新实例。
public DecryptionOptions(string ownerPassword)
参数
属性
OwnerPassword
拥有者密码。
public string OwnerPassword { get; set; }
属性值
string
Class DecryptOptions
信息
表示 Documentize.PdfSecurity 插件的解密选项。
public class DecryptOptions : PluginBaseOptions, IPluginOptions
继承
object ←
PluginBaseOptions ←
DecryptOptions
实现
继承的成员
- PluginBaseOptions.AddInput(IData),
- PluginBaseOptions.AddOutput(IData),
- PluginBaseOptions.Inputs,
- PluginBaseOptions.Outputs,
- PluginBaseOptions.CloseInputStreams,
- PluginBaseOptions.CloseOutputStreams,
- object.GetType(),
- object.MemberwiseClone(),
- object.ToString(),
- object.Equals(object?),
- object.Equals(object?, object?),
- object.ReferenceEquals(object?, object?),
- object.GetHashCode()
构造函数
DecryptOptions(string)
使用默认选项初始化 Documentize.DecryptOptions 对象的新实例。
public DecryptOptions(string ownerPassword)
参数
属性
OwnerPassword
所有者密码。
public string OwnerPassword { get; set; }
属性值
string
Class DirectoryData
public sealed class DirectoryData : IData
继承
object ←
DirectoryData
实现
继承的成员
构造函数
DirectoryData(string)
使用指定的路径初始化新的目录数据。
public DirectoryData(string path)
参数
属性
DataType
数据源的类型。
public DataType DataType { get; }
属性值
DataType
Path
获取当前数据所在目录的路径。
public string Path { get; }
属性值
string
Class DirectoryDataSource
public sealed class DirectoryDataSource : IDataSource
继承
object ←
DirectoryDataSource
实现
继承成员
构造函数
DirectoryDataSource(string)
使用指定路径初始化新的目录数据。
public DirectoryDataSource(string path)
参数
属性
DataType
数据源的类型。
public DataType DataType { get; }
属性值
DataType
Path
获取当前数据的目录路径。
public string Path { get; }
属性值
string
Class DocConverter
信息
表示 Documentize.DocConverter 插件。用于将 PDF 文档转换为 DOC/DOCX 格式。
[Obsolete("The class will be deleted soon. Please use PdfConverter class.")]
public static class DocConverter
Inheritance
object ←
DocConverter
Inherited Members
Methods
Process(PdfToDocOptions)
将 PDF 文档转换为 DOC/DOCX 格式。
public static ResultContainer Process(PdfToDocOptions options)
Parameters
Returns
ResultContainer :包含操作结果的对象。
Exceptions
ArgumentException
如果未设置 options。
Class EncryptionOptions
信息
表示 Documentize.Security 插件的加密选项。
public class EncryptionOptions : PluginBaseOptions, IPluginOptions
继承
object ←
PluginBaseOptions ←
EncryptionOptions
实现
继承的成员
- PluginBaseOptions.AddInput(IDataSource),
- PluginBaseOptions.AddOutput(IDataSource),
- PluginBaseOptions.Inputs,
- PluginBaseOptions.Outputs,
- PluginBaseOptions.CloseInputStreams,
- PluginBaseOptions.CloseOutputStreams,
- object.GetType(),
- object.MemberwiseClone(),
- object.ToString(),
- object.Equals(object?),
- object.Equals(object?, object?),
- object.ReferenceEquals(object?, object?),
- object.GetHashCode()
构造函数
EncryptionOptions(string, string)
使用默认选项初始化 Documentize.EncryptionOptions 对象的新实例。
public EncryptionOptions(string ownerPassword, string userPassword)
参数
属性
OwnerPassword
拥有者密码。
public string OwnerPassword { get; set; }
属性值
string
UserPassword
用户密码。
public string UserPassword { get; set; }
属性值
string
Class EncryptOptions
信息
表示 Documentize.PdfSecurity 插件的加密选项。
public class EncryptOptions : PluginBaseOptions, IPluginOptions
Inheritance
object ←
PluginBaseOptions ←
EncryptOptions
Implements
Inherited Members
- PluginBaseOptions.AddInput(IData),
- PluginBaseOptions.AddOutput(IData),
- PluginBaseOptions.Inputs,
- PluginBaseOptions.Outputs,
- PluginBaseOptions.CloseInputStreams,
- PluginBaseOptions.CloseOutputStreams,
- object.GetType(),
- object.MemberwiseClone(),
- object.ToString(),
- object.Equals(object?),
- object.Equals(object?, object?),
- object.ReferenceEquals(object?, object?),
- object.GetHashCode()
Constructors
EncryptOptions(string, string)
使用默认选项初始化 Documentize.EncryptOptions 对象的新实例。
public EncryptOptions(string ownerPassword, string userPassword)
Parameters
Properties
OwnerPassword
所有者密码。
public string OwnerPassword { get; set; }
Property Value
string
UserPassword
用户密码。
public string UserPassword { get; set; }
Property Value
string
信息
表示 Documentize.PdfForm 和 Documentize.PdfExtractor 组件的字段导出值的选项。
public sealed class ExtractFormDataToDsvOptions : PluginBaseOptions, IPluginOptions
继承关系
object ←
PluginBaseOptions ←
ExtractFormDataToDsvOptions
实现
继承的成员
- PluginBaseOptions.AddInput(IData),
- PluginBaseOptions.AddOutput(IData),
- PluginBaseOptions.Inputs,
- PluginBaseOptions.Outputs,
- PluginBaseOptions.CloseInputStreams,
- PluginBaseOptions.CloseOutputStreams,
- object.GetType(),
- object.ToString(),
- object.Equals(object?),
- object.Equals(object?, object?),
- object.ReferenceEquals(object?, object?),
- object.GetHashCode()
构造函数
初始化 Documentize.ExtractFormDataToDsvOptions 对象的新实例。
public ExtractFormDataToDsvOptions(char delimiter = ',', bool addFieldNames = false)
参数
delimiter char:指定导出数据中值之间使用的分隔符。默认值为 ‘,’。addFieldNames bool:在值前添加字段名称。格式:名称 + 分隔符 + 值 + 分隔符。
属性
在值前添加字段名称。
格式:名称 + 分隔符 + 值 + 分隔符。
public bool AddFieldName { get; set; }
属性值
bool
用于导出值的分隔符。
public char Delimiter { get; set; }
属性值
char
信息
表示 Documentize.PdfExtractor 组件的图像提取选项。
public sealed class ExtractImagesOptions : PluginBaseOptions, IPluginOptions
继承
object ←
PluginBaseOptions ←
ExtractImagesOptions
实现
继承的成员
- PluginBaseOptions.AddInput(IData),
- PluginBaseOptions.AddOutput(IData),
- PluginBaseOptions.Inputs,
- PluginBaseOptions.Outputs,
- PluginBaseOptions.CloseInputStreams,
- PluginBaseOptions.CloseOutputStreams,
- object.GetType(),
- object.ToString(),
- object.Equals(object?),
- object.Equals(object?, object?),
- object.ReferenceEquals(object?, object?),
- object.GetHashCode()
构造函数
使用默认选项初始化 Documentize.ExtractImagesOptions 对象的新实例。
public ExtractImagesOptions()
信息
表示 Documentize.PdfExtractor 组件的 PDF 属性提取选项。
public sealed class ExtractPropertiesOptions : OptionsWithInput, IHaveInput
继承
object ←
OptionsWithInput ←
ExtractPropertiesOptions
实现
继承的成员
构造函数
使用默认选项初始化 Documentize.ExtractPropertiesOptions 对象的新实例。
public ExtractPropertiesOptions()
使用指定的输入数据初始化 Documentize.ExtractPropertiesOptions 对象的新实例。
public ExtractPropertiesOptions(IData inputData)
参数
使用指定的输入文件初始化 Documentize.ExtractPropertiesOptions 对象的新实例。
public ExtractPropertiesOptions(string inputFile)
参数
使用指定的输入流初始化 Documentize.ExtractPropertiesOptions 对象的新实例。
public ExtractPropertiesOptions(Stream inputStream)
参数
属性
获取或设置输入数据。
public override IData Input { get; set; }
属性值
IData
信息
表示 Documentize.PdfExtractor 组件的文本提取选项。
public sealed class ExtractTextOptions : OptionsWithInput, IHaveInput
继承
object ←
OptionsWithInput ←
ExtractTextOptions
实现
继承成员
构造函数
为指定的文本格式模式初始化一个新的 Documentize.ExtractTextOptions 实例。
public ExtractTextOptions(TextFormattingMode formattingMode = TextFormattingMode.Raw)
参数
使用指定的数据初始化一个新的 Documentize.ExtractTextOptions 实例。
public ExtractTextOptions(IData data, TextFormattingMode formattingMode = TextFormattingMode.Raw)
参数
使用指定的文件初始化一个新的 Documentize.ExtractTextOptions 实例。
public ExtractTextOptions(string file, TextFormattingMode formattingMode = TextFormattingMode.Raw)
参数
使用指定的流初始化一个新的 Documentize.ExtractTextOptions 实例。
public ExtractTextOptions(Stream stream, TextFormattingMode formattingMode = TextFormattingMode.Raw)
参数
属性
获取或设置格式模式。
public TextFormattingMode FormattingMode { get; set; }
属性值
TextFormattingMode
获取或设置输入数据。
public override IData Input { get; set; }
属性值
IData
Class FileData
public sealed class FileData : IData
继承
object ←
FileData
实现
继承的成员
构造函数
FileData(string)
使用指定的路径初始化新的文件数据源。
public FileData(string path)
参数
属性
DataType
数据源的类型。
public DataType DataType { get; }
属性值
DataType
Path
获取当前数据的文件路径。
public string Path { get; }
属性值
string
方法
ToString()
将实例转换为 System.String。
public override string ToString()
返回值
string : 文件的路径。
Class FileDataSource
public sealed class FileDataSource : IDataSource
继承
object ←
FileDataSource
实现
继承的成员
构造函数
FileDataSource(string)
使用指定路径初始化新的文件数据源。
public FileDataSource(string path)
参数
属性
DataType
数据源的类型。
public DataType DataType { get; }
属性值
DataType
Path
获取当前数据文件的路径。
public string Path { get; }
属性值
string
Class FileResult
public sealed class FileResult : IOperationResult
Inheritance
object ←
FileResult
Implements
Inherited Members
Properties
Data
获取原始数据。
public object Data { get; }
Property Value
object
IsFile
指示结果是否为输出文件的路径。
public bool IsFile { get; }
Property Value
bool
IsStream
指示结果是否为输出流。
public bool IsStream { get; }
Property Value
bool
IsString
指示结果是否为文本字符串。
public bool IsString { get; }
Property Value
bool
Methods
ToFile()
尝试将结果转换为文件。
Returns
string : 如果结果是文件,则返回表示输出文件路径的字符串;否则返回 null。
ToStream()
尝试将结果转换为流对象。
Returns
Stream : 如果结果是流,则返回表示输出数据的流对象;否则返回 null。
Class FlattenFieldsOptions
信息
表示使用 Documentize.PdfForm 组件在文档中展开字段的选项。
public class FlattenFieldsOptions : PluginBaseOptions, IPluginOptions
继承
object ←
PluginBaseOptions ←
FlattenFieldsOptions
实现
继承成员
- PluginBaseOptions.AddInput(IData),
- PluginBaseOptions.AddOutput(IData),
- PluginBaseOptions.Inputs,
- PluginBaseOptions.Outputs,
- PluginBaseOptions.CloseInputStreams,
- PluginBaseOptions.CloseOutputStreams,
- object.GetType(),
- object.MemberwiseClone(),
- object.ToString(),
- object.Equals(object?),
- object.Equals(object?, object?),
- object.ReferenceEquals(object?, object?),
- object.GetHashCode()
构造函数
FlattenFieldsOptions()
使用默认选项初始化 Documentize.FlattenFieldsOptions 对象的新实例。
public FlattenFieldsOptions()
属性
SkipFields
不会被展开的字段列表。
public List<string> SkipFields { get; set; }
属性值
List<string>
信息
表示 Documentize.FormExporter 插件。用于将 PDF 文档的表单值导出为 DSV 或 CSV 文件。
[Obsolete("The class will be deleted soon. Please use PdfExtractor or PdfForm class.")]
public static class FormExporter
继承
object ← FormExporter
继承成员
方法
使用指定的参数启动 Documentize.FormExporter 处理。
public static ResultContainer Process(ExtractFormDataToDsvOptions options)
参数
返回值
ResultContainer :包含操作结果的对象。
异常
ArgumentException
如果未设置 options。
信息
表示 Documentize.FormExporter 插件字段导出值的选项。
public sealed class FormExportToDsvOptions : PluginBaseOptions, IPluginOptions
继承
object ←
PluginBaseOptions ←
FormExportToDsvOptions
实现
继承成员
- PluginBaseOptions.AddInput(IDataSource),
- PluginBaseOptions.AddOutput(IDataSource),
- PluginBaseOptions.Inputs,
- PluginBaseOptions.Outputs,
- PluginBaseOptions.CloseInputStreams,
- PluginBaseOptions.CloseOutputStreams,
- object.GetType(),
- object.ToString(),
- object.Equals(object?),
- object.Equals(object?, object?),
- object.ReferenceEquals(object?, object?),
- object.GetHashCode()
构造函数
初始化 Documentize.FormExportToDsvOptions 对象的新实例。
public FormExportToDsvOptions(char delimeter = ',', bool addFieldNames = false)
参数
delimeter char: 指定导出数据中值之间使用的分隔符。默认值为 ‘,’。addFieldNames bool: 在值之前添加字段名称。格式:名称 + 分隔符 + 值 + 分隔符。
属性
在值之前添加字段名称。
格式:名称 + 分隔符 + 值 + 分隔符。
public bool AddFieldName { get; set; }
属性值
bool
用于导出值的分隔符。
public char Delimeter { get; set; }
属性值
char
信息
表示 Documentize.FormFlattener 插件。用于在 PDF 文档中扁平化字段。
[Obsolete("The class will be deleted soon. Please use PdfForm class.")]
public static class FormFlattener
继承
object ←
FormFlattener
继承成员
方法
获取 PDF 文档中的字段名称。
public static List<string> GetFieldNames(string path)
参数
返回值
List<string>
PDF 文档中字段名称的列表。
获取 PDF 文档中的字段名称。
public static List<string> GetFieldNames(Stream stream)
参数
返回值
List<string>
PDF 文档中字段名称的列表。
在 PDF 文档中扁平化表单字段。
public static ResultContainer Process(FlattenFieldsOptions options)
参数
返回值
ResultContainer:包含操作结果的对象。
异常
ArgumentException
如果未设置 options。
信息
代表 Documentize.FormFlattener 插件在文档中扁平化字段的选项。
public class FormFlattenerOptions : PluginBaseOptions, IPluginOptions
继承
object ←
PluginBaseOptions ←
FormFlattenerOptions
实现
继承的成员
- PluginBaseOptions.AddInput(IDataSource),
- PluginBaseOptions.AddOutput(IDataSource),
- PluginBaseOptions.Inputs,
- PluginBaseOptions.Outputs,
- PluginBaseOptions.CloseInputStreams,
- PluginBaseOptions.CloseOutputStreams,
- object.GetType(),
- object.MemberwiseClone(),
- object.ToString(),
- object.Equals(object?),
- object.Equals(object?, object?),
- object.ReferenceEquals(object?, object?),
- object.GetHashCode()
构造函数
使用默认选项初始化 Documentize.FormFlattenerOptions 对象的新实例。
public FormFlattenerOptions()
属性
将不被扁平化的字段列表。
public List<string> SkipFields { get; set; }
属性值
List<string>
Class GetFieldNamesOptions
信息
表示 Documentize.PdfForm 组件中获取文档字段名称的选项。
public class GetFieldNamesOptions : OptionsWithInput, IHaveInput
继承
object ←
OptionsWithInput ←
GetFieldNamesOptions
实现
继承的成员
构造函数
GetFieldNamesOptions(string)
用于带有输入文件路径的选项的构造函数。
public GetFieldNamesOptions(string path)
参数
GetFieldNamesOptions(Stream)
用于带有输入流的选项的构造函数。
public GetFieldNamesOptions(Stream stream)
参数
属性
获取或设置输入数据。
public override IData Input { get; set; }
属性值
IData
Class HtmlConverter
信息
表示 Documentize.HtmlConverter 插件。用于将 PDF 文档转换为 HTML 格式,也用于将 HTML 文档转换为 PDF 格式。
[Obsolete("The class will be deleted soon. Please use PdfConverter class.")]
public static class HtmlConverter
继承
object ←
HtmlConverter
继承的成员
方法
Process(PdfToHtmlOptions)
将 PDF 文档转换为 HTML 格式。
public static ResultContainer Process(PdfToHtmlOptions options)
参数
返回
ResultContainer :包含操作结果的对象。
异常
ArgumentException
如果未设置 options。
Process(HtmlToPdfOptions)
将 HTML 文档转换为 PDF 格式。
public static ResultContainer Process(HtmlToPdfOptions options)
参数
返回
ResultContainer :包含操作结果的对象。
异常
ArgumentException
如果未设置 options。
Class HtmlToPdfOptions
信息
表示 Documentize.PdfConverter 插件的 HTML 到 PDF 转换器选项。
public sealed class HtmlToPdfOptions : PluginBaseOptions, IPluginOptions
继承关系
object ←
PluginBaseOptions ←
HtmlToPdfOptions
实现
继承成员
- PluginBaseOptions.AddInput(IData),
- PluginBaseOptions.AddOutput(IData),
- PluginBaseOptions.Inputs,
- PluginBaseOptions.Outputs,
- PluginBaseOptions.CloseInputStreams,
- PluginBaseOptions.CloseOutputStreams,
- object.GetType(),
- object.ToString(),
- object.Equals(object?),
- object.Equals(object?, object?),
- object.ReferenceEquals(object?, object?),
- object.GetHashCode()
构造函数
HtmlToPdfOptions()
初始化 Documentize.HtmlToPdfOptions 对象的新实例。
public HtmlToPdfOptions()
属性
BasePath
HTML 文件的基础路径/URL。
public string BasePath { get; set; }
属性值
string
获取或设置渲染期间使用的可能媒体类型。
public HtmlMediaType HtmlMediaType { get; set; }
属性值
HtmlMediaType
IsRenderToSinglePage
获取或设置是否将整个文档渲染为单页。
public bool IsRenderToSinglePage { get; set; }
属性值
bool
PageInfo
获取或设置文档的页面信息。
public PageInfo PageInfo { get; set; }
属性值
PageInfo
PageLayoutOption
获取或设置布局选项。
public HtmlPageLayoutOption PageLayoutOption { get; set; }
属性值
HtmlPageLayoutOption
信息
表示 Documentize.ImageExtractor 组件。用于从 PDF 文档中提取图像。
[Obsolete("The class will be deleted soon. Please use PdfExtractor class.")]
public static class ImageExtractor
继承
object ←
ImageExtractor
继承的成员
方法
从 PDF 文档中提取图像。
public static ResultContainer Process(ExtractImagesOptions options)
参数
返回值
ResultContainer : 包含操作结果的对象。
异常
ArgumentException
如果未设置 options。
信息
表示 Documentize.ImageExtractor 插件的图像提取选项。
public sealed class ImageExtractorOptions : PluginBaseOptions, IPluginOptions
继承
object ←
PluginBaseOptions ←
ImageExtractorOptions
实现
继承的成员
- PluginBaseOptions.AddInput(IDataSource),
- PluginBaseOptions.AddOutput(IDataSource),
- PluginBaseOptions.Inputs,
- PluginBaseOptions.Outputs,
- PluginBaseOptions.CloseInputStreams,
- PluginBaseOptions.CloseOutputStreams,
- object.GetType(),
- object.ToString(),
- object.Equals(object?),
- object.Equals(object?, object?),
- object.ReferenceEquals(object?, object?),
- object.GetHashCode()
构造函数
使用默认选项初始化 Documentize.ImageExtractorOptions 对象的新实例。
public ImageExtractorOptions()
Class Info
继承
object ←
Info
继承的成员
字段
AssemblyVersion 程序集版本。
public const string AssemblyVersion = "26.9.0"
字段值
string
Product
产品名称。
public const string Product = "Documentize"
字段值
string
Class JpegConverter
信息
表示 Documentize.JpegConverter 插件。用于将 PDF 文档转换为 JPEG 格式。
[Obsolete("The class will be deleted soon. Please use PdfConverter class.")]
public static class JpegConverter
Inheritance
object ← JpegConverter
Inherited Members
Methods
Process(PdfToJpegOptions)
将 PDF 文档转换为 JPEG 格式。
public static ResultContainer Process(PdfToJpegOptions options)
Parameters
Returns
ResultContainer :包含操作结果的对象。
Exceptions
ArgumentException
如果未设置 options。
Class License
public static class License
继承
object ←
License
继承的成员
示例
展示如何激活许可证。
// Set License
License.Set("PathToLicense.lic");
方法
Set(string)
为组件授权。
public static void Set(string licenseName)
参数
licenseName string: 可以是完整文件名或短文件名。使用空字符串可切换到评估模式。
Class MergeOptions
信息
表示 Documentize.PdfManager 插件的合并选项。
public sealed class MergeOptions : PluginBaseOptions, IPluginOptions
继承
object ←
PluginBaseOptions ←
MergeOptions
实现
继承成员
- PluginBaseOptions.AddInput(IData),
- PluginBaseOptions.AddOutput(IData),
- PluginBaseOptions.Inputs,
- PluginBaseOptions.Outputs,
- PluginBaseOptions.CloseInputStreams,
- PluginBaseOptions.CloseOutputStreams,
- object.GetType(),
- object.ToString(),
- object.Equals(object?),
- object.Equals(object?, object?),
- object.ReferenceEquals(object?, object?),
- object.GetHashCode()
构造函数
MergeOptions()
使用默认选项初始化 Documentize.MergeOptions 对象的新实例。
Class Merger
信息
表示 Documentize.Merger 插件。用于将多个 PDF 文档合并为单个 PDF。
[Obsolete("The class will be deleted soon. Please use PdfManager class.")]
public static class Merger
Inheritance
object ←
Merger
Inherited Members
Methods
Process(MergeOptions)
合并 PDF 文档。
public static ResultContainer Process(MergeOptions options)
Parameters
Returns
ResultContainer :包含操作结果的对象。
Exceptions
ArgumentException
如果未设置 options。
Class Message
继承
object ←
Message
继承的成员
构造函数
Message()
属性
Content
消息的内容。
[JsonProperty("content")]
public string Content { get; set; }
属性值
string
Role
设置或获取此消息作者的角色。
[JsonProperty("role")]
[JsonConverter(typeof(StringEnumConverter), new object[] { true })]
public Role Role { get; set; }
属性值
Role
Class ObjectResult
public sealed class ObjectResult : IOperationResult
Inheritance
object ←
ObjectResult
Implements
Inherited Members
Properties
Data
获取原始数据。
public object Data { get; }
Property Value
object
IsFile
指示结果是否为输出文件的路径。
public bool IsFile { get; }
Property Value
bool
IsObject
指示结果是否为对象。
public bool IsObject { get; }
Property Value
bool
IsStream
指示结果是否为输出文件的路径。
public bool IsStream { get; }
Property Value
bool
IsString
指示结果是否为字符串。
public bool IsString { get; }
Property Value
bool
Text
返回结果的字符串表示。
public string Text { get; }
Property Value
string
Methods
ToFile()
尝试将结果转换为文件。
Returns
string : 如果结果是文件,则返回表示输出文件路径的字符串;否则返回 null。
ToStream()
尝试将结果转换为流对象。
Returns
Stream : 如果结果是流,则返回表示输出数据的流对象;否则返回 null。
ToString()
尝试将结果转换为字符串。
public override string ToString()
Returns
string : 如果结果是字符串,则返回其文本内容的字符串;否则返回 base.ToString()。
Class OptimizeOptions
信息
表示 Documentize.PdfManager 插件的 Optimize 选项。
public sealed class OptimizeOptions : PluginBaseOptions, IPluginOptions
继承
object ←
PluginBaseOptions ←
OptimizeOptions
实现
继承成员
- PluginBaseOptions.AddInput(IData),
- PluginBaseOptions.AddOutput(IData),
- PluginBaseOptions.Inputs,
- PluginBaseOptions.Outputs,
- PluginBaseOptions.CloseInputStreams,
- PluginBaseOptions.CloseOutputStreams,
- object.GetType(),
- object.ToString(),
- object.Equals(object?),
- object.Equals(object?, object?),
- object.ReferenceEquals(object?, object?),
- object.GetHashCode()
构造函数
OptimizeOptions()
使用默认选项初始化 Documentize.OptimizeOptions 对象的新实例。
线性化文档以实现以下目标:
- 尽快打开首页;
- 尽快显示下一页或通过链接跳转到下一页;
- 当页面数据通过慢速通道传输时,能够增量显示页面(优先显示最有用的数据);
- 允许用户交互(例如点击链接),即使在整个页面尚未完全接收并显示之前也能执行。
Class Optimizer
信息
表示 Documentize.Optimizer 插件。用于优化、旋转、调整大小、压缩 PDF 文档。
[Obsolete("The class will be deleted soon. Please use PdfManager class.")]
public static class Optimizer
继承
object ←
Optimizer
继承的成员
方法
Process(OptimizeOptions)
使用指定的参数启动 Documentize.Optimizer 处理。
public static ResultContainer Process(OptimizeOptions options)
参数
返回值
ResultContainer : 包含操作结果的对象。
Process(RotateOptions)
使用指定的参数启动 Documentize.Optimizer 处理。
public static ResultContainer Process(RotateOptions options)
参数
返回值
ResultContainer : 包含操作结果的对象。
Process(ResizeOptions)
使用指定的参数启动 Documentize.Optimizer 处理。
public static ResultContainer Process(ResizeOptions options)
参数
返回值
ResultContainer : 包含操作结果的对象。
Process(CompressOptions)
使用指定的参数启动 Documentize.Optimizer 处理。
public static ResultContainer Process(CompressOptions options)
参数
返回值
ResultContainer : 包含操作结果的对象。
public abstract class OptionsWithInput : IHaveInput
继承
object ←
OptionsWithInput
派生类
实现
继承的成员
字段
字段值
IData
属性
获取或设置输入数据。
public virtual IData Input { get; set; }
属性值
IData
信息
表示具有 1 个输入数据和 1 个输出数据的操作的基本选项。
public abstract class OptionsWithInputAndOutput : OptionsWithInput, IHaveInput
{
// 这里可以添加成员实现
}
Inheritance
object ←
OptionsWithInput ←
OptionsWithInputAndOutput
Derived
Implements
Inherited Members
Fields
Field Value
IData
Properties
获取或设置输出数据。
public virtual IData Output { get; set; }
Property Value
IData
Class PageInfo
public class PageInfo : PageSize
继承
object ←
PageSize ←
PageInfo
继承的成员
- PageSize.Width,
- PageSize.Height,
- PageSize.IsLandscape,
- PageSize.A0,
- PageSize.A1,
- PageSize.A2,
- PageSize.A3,
- PageSize.A4,
- PageSize.A5,
- PageSize.A6,
- PageSize.B5,
- PageSize.PageLetter,
- PageSize.PageLegal,
- PageSize.PageLedger,
- PageSize.P11x17,
- object.GetType(),
- object.MemberwiseClone(),
- object.ToString(),
- object.Equals(object?),
- object.Equals(object?, object?),
- object.ReferenceEquals(object?, object?),
- object.GetHashCode()
构造函数
PageInfo()
Documentize.PageInfo 的构造函数。
PageInfo(double, double)
Documentize.PageInfo 的构造函数。
public PageInfo(double width, double height)
参数
属性
MarginBottom
获取或设置指示底部边距的值。
public double MarginBottom { get; set; }
属性值
double
MarginLeft
获取或设置指示左侧边距的值。
public double MarginLeft { get; set; }
属性值
double
MarginRight
获取或设置指示右侧边距的值。
public double MarginRight { get; set; }
属性值
double
MarginTop
获取或设置指示顶部边距的值。
public double MarginTop { get; set; }
属性值
double
Class PageSize
继承
object ←
PageSize
派生
继承成员
构造函数
PageSize()
Documentize.PageSize 的构造函数。默认使用 A4 尺寸。
PageSize(double, double)
Documentize.PageSize 的构造函数。
public PageSize(double width, double height)
参数
属性
A0
A0 尺寸 (1189x840 mm)。
public static PageSize A0 { get; }
属性值
PageSize
A1
A1 尺寸 (840x594 mm)。
public static PageSize A1 { get; }
属性值
PageSize
A2
A2 尺寸 (594x420 mm)。
public static PageSize A2 { get; }
属性值
PageSize
A3
A3 尺寸 (420x297 mm)。
public static PageSize A3 { get; }
属性值
PageSize
A4
A4 尺寸 (297x210 mm)。
public static PageSize A4 { get; }
属性值
PageSize
A5
A5 尺寸 (210x148 mm)。
public static PageSize A5 { get; }
属性值
PageSize
A6
A6 尺寸 (148x105 mm)。
public static PageSize A6 { get; }
属性值
PageSize
B5
B5 尺寸 (250x176 mm)。
public static PageSize B5 { get; }
属性值
PageSize
Height
获取或设置页面高度。
public double Height { get; set; }
属性值
double
IsLandscape
获取页面方向。如果是横向则返回 true,竖向则返回 false。
public bool IsLandscape { get; }
属性值
bool
P11x17
11x17 英寸格式。
public static PageSize P11x17 { get; }
属性值
PageSize
PageLedger
Ledger 尺寸 (432x279 mm)。
public static PageSize PageLedger { get; }
属性值
PageSize
PageLegal
Legal 尺寸 (356x216 mm)。
public static PageSize PageLegal { get; }
属性值
PageSize
PageLetter
Letter 尺寸 (279x216 mm)。
public static PageSize PageLetter { get; }
属性值
PageSize
Width
获取或设置页面宽度。
public double Width { get; set; }
属性值
double
Class PdfAConverter
信息
表示用于处理 PDF 文档转换为 PDF/A 格式以及验证 PDF/A 合规性的插件。
[Obsolete("The class will be deleted soon. Please use PdfConverter class.")]
public static class PdfAConverter
继承
object ←
PdfAConverter
继承的成员
方法
Process(PdfToPdfAOptions)
将 PDF 文档转换为 PDF/A 格式。
public static ResultContainer Process(PdfToPdfAOptions options)
参数
返回值
ResultContainer :包含操作结果的对象。
异常
ArgumentException
如果未设置 options。
Process(PdfAValidateOptions)
检查 PDF 文档是否符合指定的 PDF/A 格式。
public static ResultContainer Process(PdfAValidateOptions options)
参数
返回值
ResultContainer :包含操作结果的对象。
异常
ArgumentException
如果未设置 options。
Class PdfAConvertOptions
信息
表示将PDF文档转换为PDF/A格式的选项,使用Documentize.PdfAConverter插件。
public sealed class PdfAConvertOptions : PdfAOptionsBase, IPluginOptions
继承
object ←
PdfAOptionsBase ←
PdfAConvertOptions
实现
继承的成员
- PdfAOptionsBase.AddInput(IDataSource),
- PdfAOptionsBase.Inputs,
- PdfAOptionsBase.PdfAVersion,
- PdfAOptionsBase.IsLowMemoryMode,
- PdfAOptionsBase.LogOutputSource,
- PdfAOptionsBase.ErrorAction,
- PdfAOptionsBase.SoftMaskAction,
- PdfAOptionsBase.CheckDifferentNamesInFontDictionaries,
- PdfAOptionsBase.AlignText,
- PdfAOptionsBase.OptimizeFileSize,
- PdfAOptionsBase.IccProfileFileName,
- object.GetType(),
- object.ToString(),
- object.Equals(object?),
- object.Equals(object?, object?),
- object.ReferenceEquals(object?, object?),
- object.GetHashCode()
构造函数
PdfAConvertOptions()
public PdfAConvertOptions()
属性
Outputs
获取添加的目标(文件或流数据源)集合,以保存操作结果。
public List<idatasource> Outputs { get; }
属性值
List<IDataSource>
方法
AddOutput(IDataSource)
添加新的结果保存目标。
public void AddOutput(IDataSource dataSource)
参数
Class PdfAOptionsBase
信息
表示 Documentize.PdfAConverter 插件选项的基类。此类提供用于配置 PDF/A 转换和验证过程的属性和方法。
表示 Documentize.PdfAConverter 插件选项的基类。
此类提供用于配置 PDF/A 转换和验证过程的属性和方法。
public abstract class PdfAOptionsBase : IPluginOptions
继承关系
object ←
PdfAOptionsBase
派生类
实现接口
继承的成员
构造函数
PdfAOptionsBase()
protected PdfAOptionsBase()
属性
AlignText
获取或设置一个值,指示在 PDF/A 转换过程中是否需要额外手段来保留文本对齐。
public bool AlignText { get; set; }
属性值
bool
备注
当设置为 true 时,转换过程将尝试恢复原始文本段的边界。
对于大多数文档而言,无需将此属性从默认的 false 更改,因为在默认转换过程中文本对齐不会改变。
CheckDifferentNamesInFontDictionaries
获取在源 PDF 文档与 PDF 规范不匹配时控制 PDF/A 转换的标志。
public bool CheckDifferentNamesInFontDictionaries { get; set; }
属性值
bool
ErrorAction
获取或设置对无法转换的对象应采取的操作。
public ConvertErrorAction ErrorAction { get; set; }
属性值
ConvertErrorAction
IccProfileFileName
获取或设置在 PDF/A 转换中使用的 ICC(International Color Consortium)配置文件的文件名,以替代默认配置文件。
public string IccProfileFileName { get; set; }
属性值
string
获取数据集合。
public List<idata> Inputs { get; }
属性值
List<IData>
IsLowMemoryMode
获取或设置在 PDF/A 转换过程中是否启用低内存模式。
public bool IsLowMemoryMode { get; set; }
属性值
bool
LogOutputSource
获取或设置日志输出的数据源。
public IData LogOutputSource { get; set; }
属性值
IData
OptimizeFileSize
获取或设置在 PDF/A 转换过程中是否尝试减小文件大小。
public bool OptimizeFileSize { get; set; }
属性值
bool
备注
当设置为 true 时,转换过程将尝试最小化生成的文件大小。
这可能会影响转换过程的性能。
PdfAVersion
获取或设置用于验证或转换的 PDF/A 标准版本。
public PdfAStandardVersion PdfAVersion { get; set; }
属性值
PdfAStandardVersion
备注
PDF/A 标准版本用于确定 PDF/A 验证和转换的合规级别。
如果将版本设置为 Documentize.PdfAStandardVersion.Auto,系统将根据文档元数据自动确定用于验证的适当 PDF/A 标准版本。
对于 PDF/A 转换过程,Documentize.PdfAStandardVersion.Auto 默认使用 PDF/A-1b 标准版本。
SoftMaskAction
获取或设置在转换带有软遮罩的图像时应采取的操作。
public ConvertSoftMaskAction SoftMaskAction { get; set; }
属性值
ConvertSoftMaskAction
方法
向集合中添加新数据。
public void AddInput(IData data)
参数
Class PdfAValidateOptions
信息
表示使用 Documentize.PdfConverter 插件对 PDF 文档进行 PDF/A 合规性验证的选项。
public sealed class PdfAValidateOptions : PdfAOptionsBase, IPluginOptions
继承
object ←
PdfAOptionsBase ←
PdfAValidateOptions
实现
继承成员
- PdfAOptionsBase.AddInput(IData),
- PdfAOptionsBase.Inputs,
- PdfAOptionsBase.PdfAVersion,
- PdfAOptionsBase.IsLowMemoryMode,
- PdfAOptionsBase.LogOutputSource,
- PdfAOptionsBase.ErrorAction,
- PdfAOptionsBase.SoftMaskAction,
- PdfAOptionsBase.CheckDifferentNamesInFontDictionaries,
- PdfAOptionsBase.AlignText,
- PdfAOptionsBase.OptimizeFileSize,
- PdfAOptionsBase.IccProfileFileName,
- object.GetType(),
- object.ToString(),
- object.Equals(object?),
- object.Equals(object?, object?),
- object.ReferenceEquals(object?, object?),
- object.GetHashCode()
构造函数
PdfAValidateOptions()
public PdfAValidateOptions()
Class PdfAValidationResult
public sealed class PdfAValidationResult
继承关系
object ←
PdfAValidationResult
继承的成员
字段
Data
获取已验证的数据源。
public readonly IData Data
字段值
IData
IsValid
获取一个值,指示验证是否成功。
public readonly bool IsValid
字段值
bool
StandardVersion
获取用于验证的 PDF/A 标准版本。
public readonly PdfAStandardVersion StandardVersion
字段值
PdfAStandardVersion
Class PdfChatGpt
[Obsolete("The class will be deleted soon. Please use PdfManager class.")]
public static class PdfChatGpt
继承
object ←
PdfChatGpt
继承成员
备注
Documentize.PdfChatGpt 用于直接向 ChatGPT 发送请求,或通过添加 PDF 文件来源并将回复保存到输出来源。
方法
Process(IPluginOptions)
此方法没有同步版本。请使用 ProcessAsync 方法。
public static ResultContainer Process(IPluginOptions options)
参数
返回值
ResultContainer
异常
NotImplementedException
ProcessAsync(IPluginOptions)
使用指定参数启动 PdfChatGpt 处理。
public static Task<resultcontainer> ProcessAsync(IPluginOptions options)
参数
返回值
Task<ResultContainer>
表示异步操作的任务对象。
异常
ArgumentException:InvalidOperationException
Class PdfChatGptOptions
信息
表示 Documentize.PdfChatGpt 插件的选项。
public class PdfChatGptOptions : IPluginOptions
继承
object ←
PdfChatGptOptions
派生
实现
继承成员
构造函数
PdfChatGptOptions()
初始化 Documentize.PdfChatGptOptions 对象的新实例。
public PdfChatGptOptions()
属性
public List<idatasource> Inputs { get; }
属性值
List<IDataSource>
输出
public List<idatasource> Outputs { get; }
属性值
List<IDataSource>
方法
向 PdfChatGpt 插件的数据集合中添加新的数据源。
public void AddInput(IDataSource dataSource)
参数
AddOutput(IDataSource)
向 PdfChatGpt 插件的数据集合中添加新的保存数据源。
public void AddOutput(IDataSource saveDataSource)
参数
Class PdfChatGptRequestOptions
信息
表示 Documentize.PdfChatGpt 插件的选项。
public class PdfChatGptRequestOptions : PdfChatGptOptions, IPluginOptions
继承
object ←
PdfChatGptOptions ←
PdfChatGptRequestOptions
实现
继承成员
- PdfChatGptOptions.AddInput(IDataSource),
- PdfChatGptOptions.AddOutput(IDataSource),
- PdfChatGptOptions.Inputs,
- PdfChatGptOptions.Outputs,
- object.GetType(),
- object.MemberwiseClone(),
- object.ToString(),
- object.Equals(object?),
- object.Equals(object?, object?),
- object.ReferenceEquals(object?, object?),
- object.GetHashCode()
构造函数
PdfChatGptRequestOptions()
使用默认选项初始化 Documentize.PdfChatGptRequestOptions 对象的新实例。
public PdfChatGptRequestOptions()
PdfChatGptRequestOptions(string, string, string, string)
使用选项初始化 Documentize.PdfChatGptRequestOptions 对象的新实例。
public PdfChatGptRequestOptions(string apiKey, string model, string apiUrl, string query)
参数
属性
ApiKey
获取或设置用于访问 ChatGPT API 的密钥。
public string ApiKey { get; set; }
属性值
string
ApiUrl
获取或设置 ChatGPT API 的 URL。
public string ApiUrl { get; set; }
属性值
string
CancellationToken
取消令牌。
public CancellationToken CancellationToken { get; set; }
属性值
CancellationToken
MaxTokens
响应中的最大令牌数。默认值为 null,表示无限。
public int? MaxTokens { get; set; }
属性值
int?
Messages
获取或设置 Documentize.Message 对象的集合。
public List<message> Messages { get; set; }
属性值
List<Message>
备注
当向选项添加多个消息时,消息集合中的顺序如下:
- 第一条消息(如果有的话)来自 options.Query,前面是内容为:“You are a helpful assistant.”,角色为“system”的消息。
- 然后(如果有的话)添加来自 options.Messages 集合的消息。
- 最后添加来自文件源的消息(如果有的话),每个文档一个消息对象,角色为“user”。
如果没有提供一条消息,则会抛出 ArgumentException。
Model
设置或获取要使用的模型的 ID。
public string Model { get; set; }
属性值
string
NumberOfChoices
为每个输入消息生成多少个聊天完成选项。
public int NumberOfChoices { get; set; }
属性值
int
Query
获取或设置发送给 ChatGPT 的字符串请求。
如果不为空,这是集合中的第一条消息,
将被发送的请求中。
public string Query { get; set; }
属性值
string
Temperature
使用的采样温度,在 0 到 2 之间。
更高的值,如 0.8,将使输出更随机,
而更低的值,如 0.2,将使其更集中和确定。
默认值为 1。
public double Temperature { get; set; }
属性值
double
Class PdfConverter
信息
表示 Documentize.PdfConverter 组件。用于将 PDF 文档转换为其他格式,如 DOCX/DOC、XLSX/XLS/CSV/XLSM/ODS、HTML、JPEG、PNG、TIFF、PDF/A。还支持执行 PDF/A 验证以及将 HTML 转换为 PDF。
表示 Documentize.PdfConverter 组件。用于将 PDF 文档转换为其他格式,如 DOCX/DOC、XLSX/XLS/CSV/XLSM/ODS、HTML、JPEG、PNG、TIFF、PDF/A。
还支持执行 PDF/A 验证以及将 HTML 转换为 PDF。
public static class PdfConverter
继承关系
object ←
PdfConverter
继承的成员
方法
Convert(PdfToDocOptions)
将 PDF 文档转换为 DOC/DOCX 格式。
public static ResultContainer Convert(PdfToDocOptions options)
参数
返回值
ResultContainer:包含操作结果的对象。
示例
示例演示如何将 PDF 文档转换为 Doc 格式。
// 创建 PdfToDocOptions 对象以设置指令
var options = new PdfToDocOptions();
// 添加输入文件路径
options.AddInput(new FileData("path_to_your_pdf_file.pdf"));
// 设置输出文件路径
options.AddOutput(new FileData("path_to_result_file.doc"));
// 执行转换
PdfConverter.Convert(options);
示例演示如何在设置 Mode 的情况下将 PDF 文档转换为 Doc 格式。
// 创建 PdfToDocOptions 对象以设置指令
var options = new PdfToDocOptions();
// 添加输入文件路径
options.AddInput(new FileData("path_to_your_pdf_file.pdf"));
// 设置输出文件路径
options.AddOutput(new FileData("path_to_result_file.doc"));
// 设置模式
options.Mode = DocConversionMode.Flow;
// 执行转换
PdfConverter.Convert(options);
异常
ArgumentException – 如果未设置 options。
Convert(PdfToXlsOptions)
将 PDF 文档转换为 XLSX/XLS/CSV/XLSM/ODS 格式。
public static ResultContainer Convert(PdfToXlsOptions options)
参数
返回值
ResultContainer:包含操作结果的对象。
示例
示例演示如何将 PDF 转换为 XLSX 文档。
// 创建 PdfToXlsOptions 对象以设置指令
var options = new PdfToXlsOptions();
// 添加输入文件路径
options.AddInput(new FileData("path_to_your_pdf_file.pdf"));
// 设置输出文件路径
options.AddOutput(new FileData("path_to_result_xlsx_file.xlsx"));
// 执行转换
PdfConverter.Convert(options);
示例演示如何将 PDF 转换为 XLS 文档。
// 创建 PdfToXlsOptions 对象以设置指令
var options = new PdfToXlsOptions();
// 添加输入文件路径
options.AddInput(new FileData("path_to_your_pdf_file.pdf"));
// 指定 XLS 格式
options.Format = PdfToXlsOptions.ExcelFormat.XMLSpreadSheet2003;
options.InsertBlankColumnAtFirst = true;
options.MinimizeTheNumberOfWorksheets = true;
// 设置输出文件路径
options.AddOutput(new FileData("path_to_result_xlsx_file.xls"));
// 执行转换
PdfConverter.Convert(options);
异常
ArgumentException – 如果未设置 options。
Convert(PdfToHtmlOptions)
将 PDF 文档转换为 HTML 格式。
public static ResultContainer Convert(PdfToHtmlOptions options)
参数
返回值
ResultContainer:包含操作结果的对象。
示例
示例演示如何将 PDF 转换为 HTML 文档。
// 创建 PdfToHtmlOptions 对象,设置保存类型为带嵌入资源的文件
var options = new PdfToHtmlOptions(PdfToHtmlOptions.SaveDataType.FileWithEmbeddedResources);
// 添加输入文件路径
options.AddInput(new FileData("path_to_input.pdf"));
// 设置输出文件路径
options.AddOutput(new FileData("path_to_output.html"));
// 执行转换
PdfConverter.Convert(options);
异常
ArgumentException – 如果未设置 options。
Convert(HtmlToPdfOptions)
将 HTML 文档转换为 PDF 格式。
public static ResultContainer Convert(HtmlToPdfOptions options)
参数
返回值
ResultContainer:包含操作结果的对象。
示例
示例演示如何将 HTML 转换为 PDF 文档。
// 创建 HtmlToPdfOptions
var options = new HtmlToPdfOptions();
// 添加输入文件路径
options.AddInput(new FileData("path_to_input.html"));
// 设置输出文件路径
options.AddOutput(new FileData("path_to_output.pdf"));
// 执行转换
PdfConverter.Convert(options);
异常
ArgumentException – 如果未设置 options。
Convert(PdfToJpegOptions)
将 PDF 文档转换为 JPEG 格式。
public static ResultContainer Convert(PdfToJpegOptions options)
参数
返回值
ResultContainer:包含操作结果的对象。
示例
示例演示如何将 PDF 文档转换为 JPEG 格式。
// 创建 PdfToJpegOptions 对象以设置指令
var options = new PdfToJpegOptions();
// 添加输入文件路径
options.AddInput(new FileData("path_to_input.pdf"));
// 设置输出目录路径
options.AddOutput(new DirectoryData("path_to_output_directory"));
// 执行转换
PdfConverter.Convert(options);
示例演示如何在设置页面、分辨率、质量的情况下将 PDF 文档转换为 JPEG 格式。
// 创建 PdfToJpegOptions 对象以设置指令
var options = new PdfToJpegOptions();
// 只处理第一页
options.PageList = [1];
// 设置输出分辨率为 200 DPI
options.OutputResolution = 200;
// 设置输出质量为 50
options.Quality = 50;
// 添加输入文件路径
options.AddInput(new FileData("path_to_input.pdf"));
// 设置输出目录路径
options.AddOutput(new DirectoryData("path_to_output_directory"));
// 执行转换
PdfConverter.Convert(options);
示例演示如何将 PDF 文档转换为 JPEG 流。
// 创建 PdfToJpegOptions 对象以设置指令
var options = new PdfToJpegOptions();
// 添加输入文件路径
options.AddInput(new FileData("path_to_input.pdf"));
// 执行转换
var results = PdfConverter.Convert(options);
// 获取流结果
foreach (var result in results.ResultCollection)
{
var streamResultPage1 = result.ToStream();
}
异常
ArgumentException – 如果未设置 options。
Convert(PdfToPngOptions)
将 PDF 文档转换为 PNG 格式。
public static ResultContainer Convert(PdfToPngOptions options)
参数
返回值
ResultContainer:包含操作结果的对象。
示例
示例演示如何将 PDF 文档转换为 PNG 格式。
// 创建 PdfToPngOptions 对象以设置指令
var options = new PdfToPngOptions();
// 添加输入文件路径
options.AddInput(new FileData("path_to_input.pdf"));
// 设置输出目录路径
options.AddOutput(new DirectoryData("path_to_output_directory"));
// 执行转换
PdfConverter.Convert(options);
示例演示如何将 PDF 的单页转换为 PNG 格式。
// 创建 PdfToPngOptions 对象以设置指令
var options = new PdfToPngOptions();
// 只处理第一页
options.PageList = [1];
// 设置输出分辨率为 200 DPI
options.OutputResolution = 200;
// 添加输入文件路径
options.AddInput(new FileData("path_to_input.pdf"));
// 设置输出目录路径
options.AddOutput(new DirectoryData("path_to_output_directory"));
// 执行转换
PdfConverter.Convert(options);
示例演示如何将 PDF 文档转换为 PNG 流。
// 创建 PdfToPngOptions 对象以设置指令
var options = new PdfToPngOptions();
// 添加输入文件路径
options.AddInput(new FileData("path_to_input.pdf"));
// 执行转换
var results = PdfConverter.Convert(options);
// 获取流结果
foreach (var result in results.ResultCollection)
{
var streamResultPage1 = result.ToStream();
}
异常
ArgumentException – 如果未设置 options。
Convert(PdfToTiffOptions)
将 PDF 文档转换为 TIFF 格式。
public static ResultContainer Convert(PdfToTiffOptions options)
参数
返回值
ResultContainer:包含操作结果的对象。
示例
示例演示如何将 PDF 文档转换为 TIFF 格式。
// 创建 PdfToTiffOptions 对象以设置指令
var options = new PdfToTiffOptions();
// 添加输入文件路径
options.AddInput(new FileData("path_to_your_pdf_file.pdf"));
// 设置输出目录路径
options.AddOutput(new DirectoryData("path_to_output_directory"));
// 执行转换
PdfConverter.Convert(options);
示例演示如何在自定义页面和 DPI 的情况下将 PDF 文档转换为 TIFF 格式。
// 创建 PdfToTiffOptions 对象以设置指令
var options = new PdfToTiffOptions();
// 添加输入文件路径
options.AddInput(new FileData("path_to_your_pdf_file.pdf"));
// 设置输出目录路径
options.AddOutput(new DirectoryData("path_to_output_directory"));
// 设置页面
options.PageList = [1, 3];
// 设置输出图像分辨率
options.OutputResolution = 400;
// 执行转换
PdfConverter.Convert(options);
示例演示如何将 PDF 文档转换为多页 TIFF。
// 创建 PdfToTiffOptions 对象以设置指令
var options = new PdfToTiffOptions();
// 添加输入文件路径
options.AddInput(new FileData("path_to_your_pdf_file.pdf"));
// 设置输出目录路径
options.AddOutput(new DirectoryData("path_to_output_directory"));
// 启用多页 TIFF 输出
options.MultiPage = true;
// 执行转换
PdfConverter.Convert(options);
示例演示如何在自定义压缩和色深的情况下将 PDF 文档转换为 TIFF 格式。
// 创建 PdfToTiffOptions 对象以设置指令
var options = new PdfToTiffOptions();
// 添加输入文件路径
options.AddInput(new FileData("path_to_your_pdf_file.pdf"));
// 设置输出目录路径
options.AddOutput(new DirectoryData("path_to_output_directory"));
// 设置压缩和色深
options.Compression = TiffCompression.RLE;
options.ColorDepth = TiffColorDepth.Format24bpp;
// 执行转换
PdfConverter.Convert(options);
示例演示如何将 PDF 文档转换为 TIFF 流。
// 创建 PdfToTiffOptions 对象以设置指令
var options = new PdfToTiffOptions();
// 添加输入文件路径
options.AddInput(new FileData("path_to_input.pdf"));
// 执行转换
var results = PdfConverter.Convert(options);
// 获取流结果
foreach (var result in results.ResultCollection)
{
var streamResultPage1 = result.ToStream();
}
异常
ArgumentException – 如果未设置 options。
Convert(PdfToPdfAOptions)
将 PDF 文档转换为 PDF/A 格式。
public static ResultContainer Convert(PdfToPdfAOptions options)
参数
返回值
ResultContainer:包含操作结果的对象。
示例
示例演示如何将 PDF 文档转换为 PDF/A 格式(此处为 PDF/A-3b):
// 创建选项类以设置转换过程
var options = new PdfToPdfAOptions
{
PdfAVersion = PdfAStandardVersion.PDF_A_3B
};
// 添加源文件
options.AddInput(new FileData("path_to_your_pdf_file.pdf")); // 替换为实际文件路径
// 添加保存转换后文件的路径
options.AddOutput(new FileData("path_to_the_converted_file.pdf"));
// 运行转换
PdfConverter.Convert(options);
异常
ArgumentException – 如果未设置 options。
Validate(PdfAValidateOptions)
检查 PDF 文档是否符合指定的 PDF/A 格式。
public static ResultContainer Validate(PdfAValidateOptions options)
参数
返回值
ResultContainer:包含操作结果的对象。
示例
示例演示如何验证 PDF 文档是否符合 PDF/A 格式(此处为 PDF/A-1a):
// 创建选项类以设置验证过程
var options = new PdfAValidateOptions
{
PdfAVersion = PdfAStandardVersion.PDF_A_1A
};
// 添加一个或多个待验证的文件
options.AddInput(new FileData("path_to_your_first_pdf_file.pdf")); // 替换为实际文件路径
options.AddInput(new FileData("path_to_your_second_pdf_file.pdf"));
// 根据需要添加更多文件
// 运行验证并获取结果
var resultContainer = PdfConverter.Validate(options);
// 检查 resultContainer.ResultCollection 属性,获取每个文件的验证结果:
foreach (var result in resultContainer.ResultCollection)
{
var validationResult = (PdfAValidationResult) result.Data;
var isValid = validationResult.IsValid; // 文档的验证结果
}
异常
ArgumentException – 如果未设置 options。
Class PdfConverterOptions
public abstract class PdfConverterOptions : IPluginOptions
继承
object ←
PdfConverterOptions
派生
实现
继承的成员
属性
返回 PdfConverterOptions 插件数据集合。
public List<idatasource> Inputs { get; }
属性值
List<IDataSource>
输出
获取用于保存操作结果的添加目标集合。
public List<idatasource> Outputs { get; }
属性值
List<IDataSource>
方法
向 PdfConverter 插件数据集合添加新的数据源。
public void AddInput(IDataSource dataSource)
参数
AddOutput(IDataSource)
向 PdfToXLSXConverterOptions 插件数据集合添加新的数据源。
public void AddOutput(IDataSource saveDataSource)
参数
异常
NotImplementedException
信息
代表 Documentize.PdfExtractor 组件。用于从 PDF 文档中提取文本、图像、表单数据、属性(元数据)。
public static class PdfExtractor
继承
object ←
PdfExtractor
继承的成员
方法
从 PDF 文档中提取文本。
public static string Extract(ExtractTextOptions options)
参数
返回值
string : 提取的文本。
示例
以下示例演示如何从 PDF 文件中提取文本内容。
// 创建 ExtractTextOptions 对象并设置输入文件路径
var options = new ExtractTextOptions("path_to_your_pdf_file.pdf");
// 执行过程并获取提取的文本
var textExtracted = PdfExtractor.Extract(options);
以下示例演示如何从 PDF 流中提取文本内容。
// 创建 ExtractTextOptions 对象并设置输入流
var stream = File.OpenRead("path_to_your_pdf_file.pdf");
var options = new ExtractTextOptions(stream);
// 执行过程并获取提取的文本
var textExtracted = PdfExtractor.Extract(options);
以下示例演示如何使用 TextFormattingMode 提取 PDF 文档的文本内容。
// 创建 ExtractTextOptions 对象并设置文件路径和 TextFormattingMode
var options = new ExtractTextOptions("path_to_your_pdf_file.pdf", TextFormattingMode.Pure);
// 执行过程并获取提取的文本
var textExtracted = PdfExtractor.Extract(options);
以下示例演示在尽可能简洁的写法中从 PDF 文件提取文本。
// 执行过程并获取提取的文本
var textExtracted = PdfExtractor.Extract(new ExtractTextOptions("path_to_your_pdf_file.pdf", TextFormattingMode.Pure));
异常
从 PDF 文档中提取图像。
public static ResultContainer Extract(ExtractImagesOptions options)
参数
返回值
ResultContainer : 包含操作结果的对象。
示例
以下示例演示如何从 PDF 文档中提取图像。
// 创建 ExtractImagesOptions 并设置指令
var options = new ExtractImagesOptions();
// 添加输入文件路径
options.AddInput(new FileData("path_to_your_pdf_file.pdf"));
// 设置输出目录路径
options.AddOutput(new DirectoryData("path_to_results_directory"));
// 执行过程
var results = PdfExtractor.Extract(options);
// 获取图像结果的路径
var imageExtracted = results.ResultCollection[0].ToFile();
以下示例演示如何将图像提取为流而不使用文件夹。
// 创建 ExtractImagesOptions 并设置指令
var options = new ExtractImagesOptions();
// 添加输入文件路径
options.AddInput(new FileData("path_to_your_pdf_file.pdf"));
// 未设置输出——结果将写入流
// 执行过程
var results = PdfExtractor.Extract(options);
// 获取流
var ms = results.ResultCollection[0].ToStream();
// 为演示复制数据到文件
ms.Seek(0, SeekOrigin.Begin);
using (var fs = File.Create("test_file.png"))
{
ms.CopyTo(fs);
}
异常
从 PDF 文档中提取表单数据。
public static ResultContainer Extract(ExtractFormDataToDsvOptions options)
参数
返回值
ResultContainer : 包含操作结果的对象。
示例
以下示例演示如何将表单值导出为 CSV 文件。
// 创建 ExtractFormDataToDsvOptions 并设置指令
var options = new ExtractFormDataToDsvOptions(',', true);
// 添加输入文件路径
options.AddInput(new FileData("path_to_your_pdf_file.pdf"));
// 设置输出文件路径
options.AddOutput(new FileData("path_to_result_csv_file.csv"));
// 执行过程
PdfExtractor.Extract(options);
以下示例演示如何将表单值导出为 TSV 文件并设置属性。
// 创建 ExtractFormDataToDsvOptions 并设置指令
var options = new ExtractFormDataToDsvOptions();
// 设置分隔符
options.Delimiter = '\t';
// 添加字段名到结果
options.AddFieldName = true;
// 添加输入文件路径
options.AddInput(new FileData("path_to_your_pdf_file.pdf"));
// 设置输出文件路径
options.AddOutput(new FileData("path_to_result_csv_file.tsv"));
// 执行过程
PdfExtractor.Extract(options);
异常
从 PDF 文档中提取属性。
public static PdfProperties Extract(ExtractPropertiesOptions options)
参数
返回值
PdfProperties : 包含操作结果的对象。
示例
以下示例演示如何从 PDF 文件中提取属性(文件名、标题、作者、主题、关键字、创建时间、修改时间、应用程序、PDF 生成器、页数)。
// 创建 ExtractPropertiesOptions 并设置输入文件
var options = new ExtractPropertiesOptions("path_to_your_pdf_file.pdf");
// 执行过程并获取属性
var pdfProperties = PdfExtractor.Extract(options);
var filename = pdfProperties.FileName;
var title = pdfProperties.Title;
var author = pdfProperties.Author;
var subject = pdfProperties.Subject;
var keywords = pdfProperties.Keywords;
var created = pdfProperties.Created;
var modified = pdfProperties.Modified;
var application = pdfProperties.Application;
var pdfProducer = pdfProperties.PdfProducer;
var numberOfPages = pdfProperties.NumberOfPages;
以下示例演示如何从 PDF 流中提取属性(标题、作者、主题、关键字、创建时间、修改时间、应用程序、PDF 生成器、页数)。
// 创建 ExtractPropertiesOptions 并设置输入流
var stream = File.OpenRead("path_to_your_pdf_file.pdf");
var options = new ExtractPropertiesOptions(stream);
// 执行过程并获取属性
var pdfProperties = PdfExtractor.Extract(options);
var title = pdfProperties.Title;
var author = pdfProperties.Author;
var subject = pdfProperties.Subject;
var keywords = pdfProperties.Keywords;
var created = pdfProperties.Created;
var modified = pdfProperties.Modified;
var application = pdfProperties.Application;
var pdfProducer = pdfProperties.PdfProducer;
var numberOfPages = pdfProperties.NumberOfPages;
以下示例演示在最简写法中从 PDF 文件提取属性。
// 执行过程并获取属性
var pdfProperties = PdfExtractor.Extract(new ExtractPropertiesOptions("path_to_your_pdf_file.pdf"));
异常
信息
表示 Documentize.PdfForm 组件。用于扁平化、提取表单数据。也允许获取字段名称。
表示 Documentize.PdfForm 组件。用于扁平化、提取表单数据。
也允许获取字段名称。
public static class PdfForm
继承
object ←
PdfForm
继承成员
方法
从 PDF 文档中提取表单数据。
public static ResultContainer Extract(ExtractFormDataToDsvOptions options)
参数
返回
ResultContainer :包含操作结果的对象。
示例
示例演示如何将表单值导出为 CSV 文件。
// 创建 ExtractFormDataToDsvOptions 对象以设置指令
var options = new ExtractFormDataToDsvOptions(',', true);
// 添加输入文件路径
options.AddInput(new FileData("path_to_your_pdf_file.pdf"));
// 设置输出文件路径
options.AddOutput(new FileData("path_to_result_csv_file.csv"));
// 执行处理
PdfForm.Extract(options);
示例演示如何将表单值导出为 TSV 文件并设置属性。
// 创建 ExtractFormDataToDsvOptions 对象以设置指令
var options = new ExtractFormDataToDsvOptions();
// 设置分隔符
options.Delimiter = '\t';
// 添加字段名称到结果
options.AddFieldName = true;
// 添加输入文件路径
options.AddInput(new FileData("path_to_your_pdf_file.pdf"));
// 设置输出文件路径
options.AddOutput(new FileData("path_to_result_csv_file.tsv"));
// 执行处理
PdfForm.Extract(options);
异常
ArgumentException
如果未设置 options。
在 PDF 文档中扁平化字段。
public static ResultContainer Flatten(FlattenFieldsOptions options)
参数
返回
ResultContainer :包含操作结果的对象。
示例
示例演示如何在 PDF 文件中扁平化字段。
// 创建 FlattenFieldsOptions 对象以设置指令
var options = new FlattenFieldsOptions();
// 添加输入文件路径
options.AddInput(new FileData("path_to_your_pdf_file.pdf"));
// 设置输出文件路径
options.AddOutput(new FileData("path_to_result_pdf_file.pdf"));
// 执行处理
PdfForm.Flatten(options);
示例演示如何在 PDF 文件中扁平化字段并跳过第一个字段。
// 获取字段名称
var fieldNames = PdfForm.GetNames(new GetFieldNamesOptions("path_to_your_pdf_file.pdf"));
// 创建 FlattenFieldsOptions 对象以设置指令
var options = new FlattenFieldsOptions();
options.AddInput(new FileData("path_to_your_pdf_file.pdf"));
options.AddOutput(new FileData("path_to_result_pdf_file.pdf"));
// 跳过 1 个字段。
options.SkipFields.Add(fieldNames[0]);
// 执行处理
PdfForm.Flatten(options);
异常
ArgumentException
如果未设置 options。
获取 PDF 文档中的字段名称。
public static List<string> GetNames(GetFieldNamesOptions options)
参数
返回
List<string>
PDF 文档中的名称列表。
示例
示例演示如何从 PDF 文件中获取字段名称。
// 获取字段名称
var fieldNames = PdfForm.GetNames(new GetFieldNamesOptions("path_to_your_pdf_file.pdf"));
示例演示如何从 PDF 流中获取字段名称。
// 准备输入流
using var inputStream = File.OpenRead("path_to_your_pdf_file.pdf");
// 获取字段名称
var fieldNames = PdfForm.GetNames(new GetFieldNamesOptions(inputStream));
public static ResultContainer Remove(RemoveFieldsOptions options)
参数
返回
ResultContainer :包含操作结果的对象。
示例
示例演示如何从 PDF 文件中移除字段。
// 创建 RemoveFieldsOptions 对象以设置指令
var options = new RemoveFieldsOptions();
// 添加输入文件路径
options.AddInput(new FileData("path_to_your_pdf_file.pdf"));
// 设置输出文件路径
options.AddOutput(new FileData("path_to_result_pdf_file.pdf"));
// 执行处理
PdfForm.Remove(options);
异常
ArgumentException
如果未设置 options。
Class PdfProperties
public class PdfProperties
Inheritance
object ←
PdfProperties
Inherited Members
Constructors
PdfProperties()
Properties
Application
获取或设置 PDF 应用程序。
public string Application { get; set; }
Property Value
string
Author
获取或设置 PDF 作者。
public string Author { get; set; }
Property Value
string
Created
获取或设置 PDF 创建日期。
public DateTime? Created { get; set; }
Property Value
DateTime?
FileName
获取或设置 PDF 文件名(如果可用)。
public string FileName { get; set; }
Property Value
string
Keywords
获取或设置 PDF 关键字。
public string Keywords { get; set; }
Property Value
string
Modified
获取或设置 PDF 修改日期。
public DateTime? Modified { get; set; }
Property Value
DateTime?
NumberOfPages
获取或设置 PDF 页数。
public int NumberOfPages { get; set; }
Property Value
int
PdfProducer
获取或设置 PDF 生成器。
public string PdfProducer { get; set; }
Property Value
string
Subject
获取或设置 PDF 主题。
public string Subject { get; set; }
Property Value
string
Title
获取或设置 PDF 标题。
public string Title { get; set; }
Property Value
string
Class PdfSecurity
信息
表示 Documentize.PdfSecurity 组件。用于加密、解密、签名、清理 PDF 文档。
public static class PdfSecurity
继承
object ←
PdfSecurity
继承成员
方法
Decrypt(DecryptOptions)
解密 PDF 文档。
public static ResultContainer Decrypt(DecryptOptions options)
参数
返回值
ResultContainer :包含操作结果的对象。
示例
下面的示例演示如何解密 PDF 文档。
// 创建 DecryptOptions 对象以设置指令
var options = new DecryptOptions("123456");
// 添加输入文件路径
options.AddInput(new FileData("path_to_your_pdf_file.pdf"));
// 设置输出文件路径
options.AddOutput(new FileData("path_to_result_pdf_file.pdf"));
// 执行处理
PdfSecurity.Decrypt(options);
异常
ArgumentException
如果未设置 options。
Encrypt(EncryptOptions)
加密 PDF 文档。
public static ResultContainer Encrypt(EncryptOptions options)
参数
返回值
ResultContainer :包含操作结果的对象。
示例
下面的示例演示如何加密 PDF 文档。
// 创建 EncryptOptions 对象以设置指令
var options = new EncryptOptions("123456", "qwerty");
// 添加输入文件路径
options.AddInput(new FileData("path_to_your_pdf_file.pdf"));
// 设置输出文件路径
options.AddOutput(new FileData("path_to_result_pdf_file.pdf"));
// 执行处理
PdfSecurity.Encrypt(options);
异常
ArgumentException
如果未设置 options。
Sanitize(SanitizeOptions)
清理 PDF 文档中的隐藏数据,确保元数据、附件、注释、JavaScript、表单、图层、搜索索引或私有内容等敏感或不必要的信息被删除或转换。
public static ResultContainer Sanitize(SanitizeOptions options)
参数
返回值
ResultContainer :包含操作结果的对象。
示例
下面的示例演示如何清理 PDF 文档。
// 创建 SanitizeOptions 对象以设置输入和输出文件
var options = new SanitizeOptions("path_to_your_pdf_file.pdf", "path_to_result_pdf_file.pdf");
// 执行处理
PdfSecurity.Sanitize(options);
下面的示例演示如何在流之间清理 PDF。
// 准备输入输出流
using var inputStream = File.OpenRead("path_to_your_pdf_file.pdf");
using var outputStream = new MemoryStream();
// 创建 SanitizeOptions 对象以设置输入输出流
var options = new SanitizeOptions(inputStream, outputStream);
// 执行处理
PdfSecurity.Sanitize(options);
下面的示例演示如何将文件输入、流输出进行清理。
// 准备输出流
using var outputStream = new MemoryStream();
// 创建 SanitizeOptions 对象以设置输入文件和输出流
var options = new SanitizeOptions("path_to_your_pdf_file.pdf", outputStream);
// 执行处理
PdfSecurity.Sanitize(options);
下面的示例演示如何手动设置输入输出属性进行文件到流的清理。
// 准备输出流
using var outputStream = new MemoryStream();
// 创建 SanitizeOptions 对象
var options = new SanitizeOptions();
// 设置输入文件
options.Input = new FileData("path_to_your_pdf_file.pdf");
// 设置输出流
options.Output = new StreamData(outputStream);
// 执行处理
PdfSecurity.Sanitize(options);
下面的示例演示如何在不删除元数据的情况下清理 PDF。
// 创建 SanitizeOptions 对象以设置输入和输出文件
var options = new SanitizeOptions("path_to_your_pdf_file.pdf", "path_to_result_pdf_file.pdf");
options.RemoveMetadata = false;
// 执行处理
PdfSecurity.Sanitize(options);
下面的示例演示如何在不删除附件的情况下清理 PDF。
// 创建 SanitizeOptions 对象以设置输入和输出文件
var options = new SanitizeOptions("path_to_your_pdf_file.pdf", "path_to_result_pdf_file.pdf");
options.RemoveAttachments = false;
// 执行处理
PdfSecurity.Sanitize(options);
下面的示例演示如何将所有页面转换为图像并设置结果 DPI。
// 创建 SanitizeOptions 对象以设置输入和输出文件
var options = new SanitizeOptions("path_to_your_pdf_file.pdf", "path_to_result_pdf_file.pdf");
// 开启转换并设置 DPI
options.ConvertPagesToImages = true;
options.ImageDpi = 200;
// 执行处理
PdfSecurity.Sanitize(options);
下面的示例演示如何在不删除 JavaScript 和动作的情况下清理 PDF。
// 创建 SanitizeOptions 对象以设置输入和输出文件
var options = new SanitizeOptions("path_to_your_pdf_file.pdf", "path_to_result_pdf_file.pdf");
options.RemoveJavaScriptsAndActions = false;
// 执行处理
PdfSecurity.Sanitize(options);
下面的示例演示以最简方式清理 PDF 文件。
PdfSecurity.Sanitize(new SanitizeOptions("path_to_your_pdf_file.pdf", "path_to_result_pdf_file.pdf"));
异常
ArgumentException
如果未设置 options。
Sign(SignOptions)
使用数字签名对 PDF 文档进行签名。
public static ResultContainer Sign(SignOptions options)
参数
返回值
ResultContainer :包含操作结果的对象。
示例
下面的示例演示如何签名 PDF 文档。
// 创建 SignOptions 对象以设置指令
var options = new SignOptions("path_to_your_pdf_file.pdf", "path_to_result_pdf_file.pdf", "path_to_your_pfx_file.pfx", "password_of_your_pfx_file");
// 执行处理
PdfSecurity.Sign(options);
下面的示例演示如何使用流签名 PDF 文档。
// 准备流
using var pdfStreamInput = File.OpenRead(@"path_to_your_pdf_file.pdf");
using var pfxStreamInput = File.OpenRead(@"path_to_your_pfx_file.pfx");
using var pdfStreamOutput = new MemoryStream();
// 创建 SignOptions 对象以设置指令
var options = new SignOptions(pdfStreamInput, pdfStreamOutput, pfxStreamInput, "password_of_your_pfx_file");
// 执行处理
PdfSecurity.Sign(options);
下面的示例展示如何分开设置输入输出参数进行签名。
// 创建 SignOptions 对象以设置指令
var options = new SignOptions("path_to_your_pfx_file.pfx", "password_of_your_pfx_file");
// 设置输入和输出文件路径
options.Input = new FileData("path_to_your_pdf_file.pdf");
options.Output = new FileData("path_to_result_pdf_file.pdf");
// 执行处理
PdfSecurity.Sign(options);
下面的示例演示如何使用 PFX 文件流签名 PDF 文档。
using var pfxStream = File.OpenRead(@"path_to_your_pfx_file.pfx");
var options = new SignOptions(pfxStream, "password_of_your_pfx_file");
// 设置输入和输出文件路径
options.Input = new FileData("path_to_your_pdf_file.pdf");
options.Output = new FileData("path_to_result_pdf_file.pdf");
// 执行处理
PdfSecurity.Sign(options);
下面的示例演示如何使用不可见签名进行签名。
// 创建 SignOptions 对象以设置指令
var options = new SignOptions("path_to_your_pdf_file.pdf", "path_to_result_pdf_file.pdf", "path_to_your_pfx_file.pfx", "password_of_your_pfx_file");
// 配置不可见签名
options.Visible = false;
// 执行处理
PdfSecurity.Sign(options);
下面的示例演示如何使用额外选项进行签名。
// 创建 SignOptions 对象以设置指令
var options = new SignOptions("path_to_your_pdf_file.pdf", "path_to_result_pdf_file.pdf","path_to_your_pfx_file.pfx", "password_of_your_pfx_file");
// 可选参数
options.Reason = "my Reason";
options.Contact = "my Contact";
options.Location = "my Location";
options.PageNumber = 3;
// 执行处理
PdfSecurity.Sign(options);
下面的示例演示以最简方式签名 PDF 文件。
PdfSecurity.Sign(new SignOptions("path_to_your_pdf_file.pdf", "path_to_result_pdf_file.pdf", "path_to_your_pfx_file.pfx", "password_of_your_pfx_file"));
下面的示例演示如何为 PDF 文档添加时间戳签名。
// 创建 SignOptions 对象以设置时间戳
var options = new SignOptions(new TimestampOptions("server_url"));
// 设置输入和输出文件路径
options.Input = new FileData("path_to_your_pdf_file.pdf");
options.Output = new FileData("path_to_result_pdf_file.pdf");
// 执行处理
PdfSecurity.Sign(options);
异常
ArgumentException
如果未设置 options。
Class PdfToDocOptions
信息
表示 Documentize.PdfConverter 插件的 PDF 转 DOC 转换器选项。
public sealed class PdfToDocOptions : PluginBaseOptions, IPluginOptions
继承
object ←
PluginBaseOptions ←
PdfToDocOptions
实现
继承的成员
构造函数
PdfToDocOptions()
使用默认选项初始化 Documentize.PdfToDocOptions 对象的新实例。
属性
Mode
控制 PDF 文档如何转换为文字处理文档。
public DocConversionMode Mode { get; set; }
属性值
DocConversionMode
备注
使用 Documentize.DocConversionMode.TextBox 模式,当生成的文档后续不会进行大量编辑时。文本框在修改内容不多的情况下很容易编辑。
使用 Documentize.DocConversionMode.Flow 模式,当输出文档需要进一步编辑时。流模式下的段落和文本行便于修改文本,但不受支持的格式对象的显示效果会比 TextBox 模式差。
Class PdfToHtmlOptions
信息
表示 Documentize.PdfConverter 插件的 PDF 到 HTML 转换器选项。
public sealed class PdfToHtmlOptions : PluginBaseOptions, IPluginOptions
继承
object ←
PluginBaseOptions ←
PdfToHtmlOptions
实现
继承的成员
构造函数
PdfToHtmlOptions(SaveDataType)
为指定的输出数据类型初始化 Documentize.PdfToHtmlOptions 对象的新实例。
public PdfToHtmlOptions(PdfToHtmlOptions.SaveDataType outputDataType = SaveDataType.FileWithExternalResources)
参数
属性
OutputDataType
获取输出数据类型。
public PdfToHtmlOptions.SaveDataType OutputDataType { get; }
属性值
PdfToHtmlOptions.SaveDataType
Class PdfToJpegOptions
信息
表示 Documentize.PdfConverter 插件的 PDF 转 JPEG 转换器选项。
public sealed class PdfToJpegOptions : PluginBaseOptions, IPluginOptions
继承关系
object ←
PluginBaseOptions ←
PdfToJpegOptions
实现
继承的成员
- PluginBaseOptions.AddInput(IData),
- PluginBaseOptions.AddOutput(IData),
- PluginBaseOptions.Inputs,
- PluginBaseOptions.Outputs,
- PluginBaseOptions.CloseInputStreams,
- PluginBaseOptions.CloseOutputStreams,
- object.GetType(),
- object.ToString(),
- object.Equals(object?),
- object.Equals(object?, object?),
- object.ReferenceEquals(object?, object?),
- object.GetHashCode()
构造函数
PdfToJpegOptions()
初始化一个新的 Documentize.PdfToJpegOptions 对象实例。
public PdfToJpegOptions()
属性
OutputResolution
获取或设置生成图像的分辨率值。
public int OutputResolution { get; set; }
属性值
int
PageList
获取或设置要处理的页面列表。
public List<int> PageList { get; set; }
属性值
List<int>
Quality
获取和设置输出质量。
指定图像的压缩级别。
质量的有效范围为 0 到 100。
指定的数字越低,压缩越高,图像质量越低。
0 代表最低质量的图像,100 代表最高质量的图像。
public int Quality { get; set; }
属性值
int
Class PdfToPdfAOptions
信息
表示使用 Documentize.PdfConverter 插件将 PDF 文档转换为 PDF/A 格式的选项。
public sealed class PdfToPdfAOptions : PdfAOptionsBase, IPluginOptions
继承
object ←
PdfAOptionsBase ←
PdfToPdfAOptions
实现
继承的成员
- PdfAOptionsBase.AddInput(IData),
- PdfAOptionsBase.Inputs,
- PdfAOptionsBase.PdfAVersion,
- PdfAOptionsBase.IsLowMemoryMode,
- PdfAOptionsBase.LogOutputSource,
- PdfAOptionsBase.ErrorAction,
- PdfAOptionsBase.SoftMaskAction,
- PdfAOptionsBase.CheckDifferentNamesInFontDictionaries,
- PdfAOptionsBase.AlignText,
- PdfAOptionsBase.OptimizeFileSize,
- PdfAOptionsBase.IccProfileFileName,
- object.GetType(),
- object.ToString(),
- object.Equals(object?),
- object.Equals(object?, object?),
- object.ReferenceEquals(object?, object?),
- object.GetHashCode()
构造函数
PdfToPdfAOptions()
public PdfToPdfAOptions()
属性
Outputs
获取用于保存操作结果的已添加目标(文件或流数据源)的集合。
public List<IData> Outputs { get; }
属性值
List<IData>
方法
AddOutput(IData)
添加新的结果保存目标。
public void AddOutput(IData data)
参数
data IData: 用于保存操作结果的目标(文件或流数据源)。
Class PdfToPngOptions
信息
表示 Documentize.PdfConverter 插件的 PDF 到 PNG 转换器选项。
public sealed class PdfToPngOptions : PluginBaseOptions, IPluginOptions
继承
object ←
PluginBaseOptions ←
PdfToPngOptions
实现
继承成员
- PluginBaseOptions.AddInput(IData),
- PluginBaseOptions.AddOutput(IData),
- PluginBaseOptions.Inputs,
- PluginBaseOptions.Outputs,
- PluginBaseOptions.CloseInputStreams,
- PluginBaseOptions.CloseOutputStreams,
- object.GetType(),
- object.ToString(),
- object.Equals(object?),
- object.Equals(object?, object?),
- object.ReferenceEquals(object?, object?),
- object.GetHashCode()
构造函数
PdfToPngOptions()
初始化 Documentize.PdfToPngOptions 对象的新实例。
属性
OutputResolution
获取或设置生成图像的分辨率值。
public int OutputResolution { get; set; }
属性值
int
PageList
获取或设置用于处理的页码列表。
public List<int> PageList { get; set; }
属性值
List<int>
Class PdfToTiffOptions
信息
表示 Documentize.PdfConverter 插件的 PDF 转 TIFF 转换器选项。
public sealed class PdfToTiffOptions : PluginBaseOptions, IPluginOptions
继承
object ←
PluginBaseOptions ←
PdfToTiffOptions
实现
继承成员
构造函数
PdfToTiffOptions()
初始化 Documentize.PdfToTiffOptions 对象的新实例。
public PdfToTiffOptions()
属性
ColorDepth
获取或设置颜色深度。
public TiffColorDepth ColorDepth { get; set; }
属性值
TiffColorDepth
备注
默认值为 Documentize.TiffColorDepth.Format32bpp。
Compression
获取或设置压缩类型。
public TiffCompression Compression { get; set; }
属性值
TiffCompression
备注
默认值为 Documentize.TiffCompression.LZW。
MultiPage
获取并设置允许将所有页面保存为一个多页 TIFF 的标志。
默认值为 false。
public bool MultiPage { get; set; }
属性值
bool
OutputResolution
获取或设置生成图像的分辨率值。
public int OutputResolution { get; set; }
属性值
int
PageList
获取或设置用于处理的页码列表。
public List<int> PageList { get; set; }
属性值
List<int>
Class PdfToXlsOptions
信息
表示 Documentize.PdfConverter 插件的 PDF 转 XLS/XLSX 转换器选项。
public sealed class PdfToXlsOptions : PluginBaseOptions, IPluginOptions
继承
object ←
PluginBaseOptions ←
PdfToXlsOptions
实现
继承成员
构造函数
PdfToXlsOptions()
使用默认选项初始化 Documentize.PdfToXlsOptions 对象的新实例。
属性
输出格式。
public PdfToXlsOptions.ExcelFormat Format { get; set; }
属性值
PdfToXlsOptions.ExcelFormat
InsertBlankColumnAtFirst
如果需要在工作表的第一列插入空白列,请设为 true。默认值为 false,表示不插入空白列。
public bool InsertBlankColumnAtFirst { get; set; }
属性值
bool
MinimizeTheNumberOfWorksheets
如果需要在生成的工作簿中尽可能减少工作表数量,请设为 true。默认值为 false,表示每个 PDF 页面保存为单独的工作表。
public bool MinimizeTheNumberOfWorksheets { get; set; }
属性值
bool
Class PluginBaseOptions
public class PluginBaseOptions : IPluginOptions
继承
object ←
PluginBaseOptions
派生类
实现
继承的成员
属性
操作完成后关闭输入流。
public bool CloseInputStreams { get; set; }
属性值
bool
CloseOutputStreams
操作完成后关闭输出流。
public bool CloseOutputStreams { get; set; }
属性值
bool
返回操作的输入数据。
public List<IData> Inputs { get; }
属性值
List<IData>
Outputs
返回操作的输出数据。
public List<IData> Outputs { get; }
属性值
List<IData>
方法
向输入集合添加新数据。
public void AddInput(IData data)
参数
AddOutput(IData)
向输出集合添加新数据。
public void AddOutput(IData data)
参数
Class PngConverter
信息
表示 Documentize.PngConverter 插件。用于将 PDF 文档转换为 PNG 格式。
[Obsolete("The class will be deleted soon. Please use PdfConverter class.")]
public static class PngConverter
继承
object ←
PngConverter
继承的成员
方法
Process(PdfToPngOptions)
将 PDF 文档转换为 PNG 格式。
public static ResultContainer Process(PdfToPngOptions options)
参数
返回值
ResultContainer :包含操作结果的对象。
异常
ArgumentException
如果未设置 options。
Class Rectangle
继承
object ←
Rectangle
继承成员
构造函数
Rectangle(double, double, double, double)
Rectangle 的构造函数。
public Rectangle(double llx, double lly, double urx, double ury)
参数
Class RemoveFieldsOptions
信息
表示通过 Documentize.PdfForm 插件在文档中删除字段的选项。
public class RemoveFieldsOptions : PluginBaseOptions, IPluginOptions
继承层次
object ←
PluginBaseOptions ←
RemoveFieldsOptions
实现
继承成员
构造函数
RemoveFieldsOptions()
使用默认选项初始化 Documentize.RemoveFieldsOptions 对象的新实例。
public RemoveFieldsOptions()
Class ResizeOptions
信息
表示 Documentize.PdfManager 插件的 Resize 选项。
public sealed class ResizeOptions : PluginBaseOptions, IPluginOptions
继承
object ←
PluginBaseOptions ←
ResizeOptions
实现
继承成员
- PluginBaseOptions.AddInput(IData),
- PluginBaseOptions.AddOutput(IData),
- PluginBaseOptions.Inputs,
- PluginBaseOptions.Outputs,
- PluginBaseOptions.CloseInputStreams,
- PluginBaseOptions.CloseOutputStreams,
- object.GetType(),
- object.ToString(),
- object.Equals(object?),
- object.Equals(object?, object?),
- object.ReferenceEquals(object?, object?),
- object.GetHashCode()
构造函数
ResizeOptions()
使用默认选项初始化 Documentize.ResizeOptions 对象的新实例。
属性
PageSize
获取或设置新的页面大小。
public PageSize PageSize { get; set; }
属性值
PageSize
Class ResultContainer
public class ResultContainer
继承
object ←
ResultContainer
继承的成员
属性
ResultCollection
获取操作结果的集合
public List<ioperationresult> ResultCollection { get; }
属性值
List<IOperationResult>
Class RotateOptions
信息
表示 Documentize.PdfManager 插件的旋转选项。
public sealed class RotateOptions : PluginBaseOptions, IPluginOptions
继承
object ←
PluginBaseOptions ←
RotateOptions
实现
继承的成员
- PluginBaseOptions.AddInput(IData),
- PluginBaseOptions.AddOutput(IData),
- PluginBaseOptions.Inputs,
- PluginBaseOptions.Outputs,
- PluginBaseOptions.CloseInputStreams,
- PluginBaseOptions.CloseOutputStreams,
- object.GetType(),
- object.ToString(),
- object.Equals(object?),
- object.Equals(object?, object?),
- object.ReferenceEquals(object?, object?),
- object.GetHashCode()
构造函数
RotateOptions()
使用默认选项初始化 Documentize.RotateOptions 对象的新实例。
属性
Rotation
获取或设置新页面的旋转。
public Rotation Rotation { get; set; }
属性值
Rotation
Class SanitizeOptions
public class SanitizeOptions : OptionsWithInputAndOutput, IHaveInput
继承
object ←
OptionsWithInput ←
OptionsWithInputAndOutput ←
SanitizeOptions
实现
继承的成员
- OptionsWithInputAndOutput.output,
- OptionsWithInputAndOutput.Output,
- OptionsWithInput.input,
- OptionsWithInput.Input,
- object.GetType(),
- object.MemberwiseClone(),
- object.ToString(),
- object.Equals(object?),
- object.Equals(object?, object?),
- object.ReferenceEquals(object?, object?),
- object.GetHashCode()
构造函数
SanitizeOptions()
使用默认选项初始化 Documentize.SanitizeOptions 对象的新实例。
SanitizeOptions(IData, IData)
使用指定的输入数据初始化 Documentize.SanitizeOptions 对象的新实例。
public SanitizeOptions(IData inputData, IData outputData = null)
参数
SanitizeOptions(string, string)
使用指定的输入文件和输出文件初始化 Documentize.SanitizeOptions 对象的新实例。
public SanitizeOptions(string inputFile, string outputFile)
参数
SanitizeOptions(Stream, Stream)
使用指定的输入流和输出流初始化 Documentize.SanitizeOptions 对象的新实例。
public SanitizeOptions(Stream inputStream, Stream outputStream)
参数
SanitizeOptions(string, Stream)
使用指定的输入文件和输出流初始化 Documentize.SanitizeOptions 对象的新实例。
public SanitizeOptions(string inputFile, Stream outputStream)
参数
SanitizeOptions(Stream, string)
使用指定的输入流和输出文件初始化 Documentize.SanitizeOptions 对象的新实例。
public SanitizeOptions(Stream inputStream, string outputFile)
参数
属性
ConvertPagesToImages
获取或设置将页面转换为图像的选项。
页面转换为图像的操作将在清除主要隐藏数据之后进行,该过程受其他选项控制。
默认值为 false。
public bool ConvertPagesToImages { get; set; }
属性值
bool
获取或设置在清理过程中是否应将文档中的表单扁平化。
扁平化表单会将交互式表单字段转换为静态内容,使其不可编辑或填写。
默认值为 true。
public bool FlattenForms { get; set; }
属性值
bool
FlattenLayers
获取或设置扁平化 PDF 文档中图层的选项。
启用后,文档中的所有图层将合并为单一图层,去除其独立结构。
此选项有助于通过简化内容并确保图层中不包含隐藏数据来清理文档。
默认值为 true。
public bool FlattenLayers { get; set; }
属性值
bool
ImageDpi
获取或设置在页面转图像过程中解析页面图像的 DPI。
仅当 Documentize.SanitizeOptions.ConvertPagesToImages 为 true 时此属性生效。
public int ImageDpi { get; set; }
属性值
int
获取或设置输入数据。
public override IData Input { get; set; }
属性值
IData
Output
获取或设置输出数据。
public override IData Output { get; set; }
属性值
IData
RemoveAnnotations
获取或设置是否从文档中删除批注。
启用后,文档中的所有批注将在清理过程中被删除,并会应用遮蔽批注。
默认值为 true。
public bool RemoveAnnotations { get; set; }
属性值
bool
RemoveAttachments
获取或设置是否删除文档中所有的附件文件。
启用后,可确保 PDF 中的任何附件在清理过程中被彻底移除。
默认值为 true。
public bool RemoveAttachments { get; set; }
属性值
bool
RemoveJavaScriptsAndActions
获取或设置是否从文档中删除 JavaScript 及其相关操作。
此选项有助于消除嵌入脚本可能带来的安全风险。
默认值为 true。
public bool RemoveJavaScriptsAndActions { get; set; }
属性值
bool
获取或设置是否删除文档元数据。
如果设为 true,文档属性及其他嵌入的元数据信息将在清理过程中被移除。
默认值为 true。
public bool RemoveMetadata { get; set; }
属性值
bool
RemoveSearchIndexAndPrivateInfo
获取或设置是否删除文档中的搜索索引和私人信息。
启用后,可移除嵌入的搜索索引和私有数据,以提升文档的安全性和隐私性。
默认值为 true。
public bool RemoveSearchIndexAndPrivateInfo { get; set; }
属性值
bool
Class Security
信息
表示 Documentize.Security 插件。用于加密和解密 PDF 文档。
[Obsolete("The class will be deleted soon. Please use PdfSecurity class.")]
public static class Security
继承
object ←
Security
继承的成员
方法
Process(EncryptOptions)
加密 PDF 文档。
public static ResultContainer Process(EncryptOptions options)
参数
返回
ResultContainer : 包含操作结果的对象。
异常
ArgumentException
如果未设置 options。
Process(DecryptOptions)
解密 PDF 文档。
public static ResultContainer Process(DecryptOptions options)
参数
返回
ResultContainer : 包含操作结果的对象。
异常
ArgumentException
如果未设置 options。
Class Signature
信息
表示 Documentize.Signature 插件。用于对 PDF 文档进行签名。
[Obsolete("The class will be deleted soon. Please use PdfSecurity class.")]
public static class Signature
继承
object ←
Signature
继承成员
方法
Process(SignOptions)
对 PDF 文档进行签名。
public static ResultContainer Process(SignOptions options)
参数
返回值
ResultContainer :包含操作结果的对象。
异常
ArgumentException
如果未设置 options。
Class SignOptions
信息
表示 Documentize.PdfSecurity 组件的签名选项。
public sealed class SignOptions : OptionsWithInputAndOutput, IHaveInput
继承
object ←
OptionsWithInput ←
OptionsWithInputAndOutput ←
SignOptions
实现
继承成员
构造函数
SignOptions(Stream, string)
使用 PFX 流和密码初始化 Documentize.SignOptions 对象的新实例。
public SignOptions(Stream pfx, string password)
参数
SignOptions(string, string)
使用 PFX 文件路径和密码初始化 Documentize.SignOptions 对象的新实例。
public SignOptions(string pfx, string password)
参数
SignOptions(IData, IData, IData, string)
使用输入、输出、PFX 数据和密码初始化 Documentize.SignOptions 对象的新实例。
public SignOptions(IData inputData, IData outputData, IData pfxData, string password)
参数
SignOptions(string, string, string, string)
使用输入文件、输出文件、PFX 文件和密码初始化 Documentize.SignOptions 对象的新实例。
public SignOptions(string inputFile, string outputFile, string pfxFile, string pfxPassword)
参数
SignOptions(Stream, Stream, Stream, string)
使用输入流、输出流、PFX 流和密码初始化 Documentize.SignOptions 对象的新实例。
public SignOptions(Stream inputStream, Stream outputStream, Stream pfxStream, string pfxPassword)
参数
SignOptions(TimestampOptions)
使用时间戳设置初始化 Documentize.SignOptions 对象的新实例。您可以将时间戳作为单独的签名添加到文档中。
public SignOptions(TimestampOptions timestampOptions)
参数
属性
签名的联系信息。
public string Contact { get; set; }
属性类型
string
获取或设置输入数据。
public override IData Input { get; set; }
属性类型
IData
Location
签名的位置。
public string Location { get; set; }
属性类型
string
Name
现有签名字段的名称。若为 null 则创建新字段。
public string Name { get; set; }
属性类型
string
Output
获取或设置输出数据。
public override IData Output { get; set; }
属性类型
IData
PageNumber
签名所在的页码。
public int PageNumber { get; set; }
属性类型
int
Pfx
包含 PFX 数据的流。
public Stream Pfx { get; set; }
属性类型
Stream
PfxPassword
Documentize.SignOptions.Pfx 的密码。
public string PfxPassword { get; set; }
属性类型
string
Reason
签名的原因。
public string Reason { get; set; }
属性类型
string
Rectangle
签名的矩形区域。
public Rectangle Rectangle { get; set; }
属性类型
Rectangle
TimestampOptions
时间戳选项。时间戳用于在无需提供证书的情况下创建时间戳签名。
- 若设置此属性且构造函数提供了证书,则数字签名将使用内嵌时间戳进行时间戳化。
- 若设置此属性但构造函数未提供证书,则时间戳将作为单独的签名添加。
public TimestampOptions TimestampOptions { get; set; }
属性类型
TimestampOptions
Visible
签名的可见性。默认值为 true。
public bool Visible { get; set; }
属性类型
bool
Class SplitOptions
信息
表示 Documentize.PdfManager 插件的拆分选项。
public sealed class SplitOptions : PluginBaseOptions, IPluginOptions
继承
object ←
PluginBaseOptions ←
SplitOptions
实现
继承成员
- PluginBaseOptions.AddInput(IData),
- PluginBaseOptions.AddOutput(IData),
- PluginBaseOptions.Inputs,
- PluginBaseOptions.Outputs,
- PluginBaseOptions.CloseInputStreams,
- PluginBaseOptions.CloseOutputStreams,
- object.GetType(),
- object.ToString(),
- object.Equals(object?),
- object.Equals(object?, object?),
- object.ReferenceEquals(object?, object?),
- object.GetHashCode()
构造函数
SplitOptions()
使用默认选项初始化 Documentize.SplitOptions 对象的新实例。
Class Splitter
信息
表示 Documentize.Splitter 插件。用于将 PDF 文档拆分为单独的页面。
[Obsolete("The class will be deleted soon. Please use PdfManager class.")]
public static class Splitter
继承
object ←
Splitter
继承的成员
方法
Process(SplitOptions)
按页拆分 PDF 文档。
public static ResultContainer Process(SplitOptions options)
参数
返回
ResultContainer : 包含操作结果的对象。
异常
ArgumentException
如果未设置 options。
Class StreamData
public sealed class StreamData : IData
继承
object ←
StreamData
实现
继承的成员
构造函数
StreamData(Stream)
使用指定的流对象初始化新的流数据源。
public StreamData(Stream data)
参数
属性
Data
获取当前数据源的流对象。
public Stream Data { get; }
属性值
Stream
DataType
数据类型(流)。
public DataType DataType { get; }
属性值
DataType
Class StreamDataSource
public sealed class StreamDataSource : IDataSource
继承
object ←
StreamDataSource
实现
继承成员
构造函数
StreamDataSource(Stream)
使用指定的流对象初始化新的流数据源。
public StreamDataSource(Stream data)
参数
属性
Data
获取当前数据源的流对象。
public Stream Data { get; }
属性值
Stream
DataType
数据源类型(流)。
public DataType DataType { get; }
属性值
DataType
Class StreamResult
public sealed class StreamResult : IOperationResult
Inheritance
object ←
StreamResult
Implements
Inherited Members
Properties
Data
获取原始数据。
public object Data { get; }
Property Value
object
IsFile
指示结果是否为输出文件的路径。
public bool IsFile { get; }
Property Value
bool
IsStream
指示结果是否为流。
public bool IsStream { get; }
Property Value
bool
IsString
指示结果是否为字符串。
public bool IsString { get; }
Property Value
bool
Methods
ToFile()
尝试将结果转换为文件。
Returns
string : 如果结果是文件,则返回表示输出文件路径的字符串;否则返回 null。
ToStream()
尝试将结果转换为流对象。
Returns
Stream : 如果结果是流,则返回表示输出数据的流对象;否则返回 null。
Class StringResult
public sealed class StringResult : IOperationResult
继承
object ←
StringResult
实现
继承的成员
属性
Data
获取原始数据。
public object Data { get; }
属性值
object
IsFile
指示结果是否为输出文件的路径。
public bool IsFile { get; }
属性值
bool
IsStream
指示结果是否为输出文件的路径。
public bool IsStream { get; }
属性值
bool
IsString
指示结果是否为字符串。
public bool IsString { get; }
属性值
bool
Text
返回结果的字符串表示。
public string Text { get; }
属性值
string
方法
ToFile()
尝试将结果转换为文件。
返回值
string : 如果结果是文件,则返回表示输出文件路径的字符串;否则返回 null。
ToStream()
尝试将结果转换为流对象。
返回值
Stream : 如果结果是流,则返回表示输出数据的流对象;否则返回 null。
ToString()
尝试将结果转换为字符串。
public override string ToString()
返回值
string : 如果结果是字符串,则返回表示文本内容的字符串;否则返回 base.ToString()。
Class TableBuilder
public class TableBuilder
继承
object ←
TableBuilder
派生
继承成员
方法
AddRow()
向表格添加新行。
public virtual TableRowBuilder AddRow()
返回值
TableRowBuilder : 当前 Documentize.TableRowBuilder 的实例。
AddTable()
向文档添加新表格。
public TableBuilder AddTable()
返回值
TableBuilder : 当前 Documentize.TableBuilder 的实例。
InsertPageAfter(int)
在指定页面之后插入页面。
public TableOptions InsertPageAfter(int page)
参数
返回值
TableOptions : 当前 Documentize.TableOptions 的实例。
InsertPageBefore(int)
在指定页面之前插入页面。
public TableOptions InsertPageBefore(int page)
参数
返回值
TableOptions : 当前 Documentize.TableOptions 的实例。
运算符
implicit operator TableOptions(TableBuilder)
将构建器 Documentize.TableBuilder 转换为选项 Documentize.TableOptions
public static implicit operator TableOptions(TableBuilder builder)
参数
返回值
TableOptions : 转换为 PdfGeneratorTableOptions 的结果。
Class TableCellBuilder
public class TableCellBuilder : TableRowBuilder
继承
object ←
TableBuilder ←
TableRowBuilder ←
TableCellBuilder
继承的成员
- TableRowBuilder.AddCell(),
- TableRowBuilder.AddRow(),
- TableBuilder.AddRow(),
- TableBuilder.AddTable(),
- TableBuilder.InsertPageAfter(int),
- TableBuilder.InsertPageBefore(int),
- object.GetType(),
- object.MemberwiseClone(),
- object.ToString(),
- object.Equals(object?),
- object.Equals(object?, object?),
- object.ReferenceEquals(object?, object?),
- object.GetHashCode()
方法
AddCell()
向表格添加单元格。
public override TableCellBuilder AddCell()
返回值
TableCellBuilder :当前 Documentize.TableCellBuilder 的实例。
AddParagraph(params string[])
向表格单元格添加段落。
public TableCellBuilder AddParagraph(params string[] paragraphs)
参数
返回值
TableCellBuilder :当前 Documentize.TableCellBuilder 的实例。
Class TableGenerator
信息
表示 Documentize.TableGenerator 插件。用于向 PDF 文档添加表格。
[Obsolete("The class will be deleted soon. Please use PdfManager class.")]
public static class TableGenerator
继承
object ←
TableGenerator
继承成员
示例
此示例演示如何向 PDF 文件添加表格。
// Configure table options
var options = new TableOptions().InsertPageBefore(1)
.AddTable()
.AddRow()
.AddCell().AddParagraph("Name")
.AddCell().AddParagraph("Age")
.AddRow()
.AddCell().AddParagraph("Bob")
.AddCell().AddParagraph("12")
.AddRow()
.AddCell().AddParagraph("Sam")
.AddCell().AddParagraph("20")
.AddRow()
.AddCell().AddParagraph("Sandy")
.AddCell().AddParagraph("26")
.AddRow()
.AddCell().AddParagraph("Tom")
.AddCell().AddParagraph("12")
.AddRow()
.AddCell().AddParagraph("Jim")
.AddCell().AddParagraph("27");
// Add input file path
options.AddInput(new FileData("path_to_input.pdf"));
// Set output file path
options.AddOutput(new FileData("path_to_output.pdf"));
// Perform the process
TableGenerator.Process(options);
方法
Process(TableOptions)
向 PDF 文档添加表格。
public static ResultContainer Process(TableOptions options)
参数
返回值
ResultContainer : 包含操作结果的对象。
异常
ArgumentException
如果未设置 options。
Class TableOptions
信息
表示通过 Documentize.PdfManager 插件向文档添加表格的选项。
public sealed class TableOptions : PluginBaseOptions, IPluginOptions
继承关系
object ←
PluginBaseOptions ←
TableOptions
实现接口
继承的成员
构造函数
TableOptions()
使用默认选项初始化 Documentize.TableOptions 对象的新实例。
方法
AddTable()
向文档添加表格。
public TableBuilder AddTable()
返回值
TableBuilder : Documentize.TableBuilder 的新实例。
Create()
创建 Documentize.TableOptions 的实例。
public static TableOptions Create()
返回值
TableOptions : Documentize.TableOptions 的新实例。
InsertPageAfter(int)
在指定页之后插入页面。
public TableOptions InsertPageAfter(int page)
参数
返回值
TableOptions : 当前 Documentize.TableOptions 实例。
InsertPageBefore(int)
在指定页之前插入页面。
public TableOptions InsertPageBefore(int page)
参数
返回值
TableOptions : 当前 Documentize.TableOptions 实例。
Class TableRowBuilder
public class TableRowBuilder : TableBuilder
继承
object ←
TableBuilder ←
TableRowBuilder
派生
继承成员
方法
AddCell()
向表行添加单元格。
public virtual TableCellBuilder AddCell()
返回值
TableCellBuilder : 已创建的 Documentize.TableCellBuilder 实例。
AddRow()
重写 AddRow。
public override TableRowBuilder AddRow()
返回值
TableRowBuilder : 当前 Documentize.TableRowBuilder 的实例。
信息
表示 Documentize.TextExtractor 组件。用于从 PDF 文档中提取文本。
[Obsolete("The class will be deleted soon. Please use PdfExtractor class.")]
public static class TextExtractor
Inheritance
object ←
TextExtractor
Inherited Members
Methods
从 PDF 文档中提取文本。
public static string Process(ExtractTextOptions options)
Parameters
Returns
string : 包含提取结果的对象。
Exceptions
ArgumentException
如果未设置 options。
信息
表示 Documentize.TextExtractor 插件的文本提取选项。
public sealed class TextExtractorOptions
继承
object ←
TextExtractorOptions
继承的成员
构造函数
为指定的文本格式模式初始化 Documentize.TextExtractorOptions 对象的新实例。
public TextExtractorOptions(TextFormattingMode formattingMode = TextFormattingMode.Raw)
参数
属性
获取格式模式。
public TextFormattingMode FormattingMode { get; set; }
属性值
TextFormattingMode
返回操作的输入数据。
public List<idatasource> Inputs { get; }
属性值
List<IDataSource>
方法
向 Inputs 添加新数据。
public void AddInput(IDataSource dataSource)
参数
Class TiffConverter
信息
表示 Documentize.TiffConverter 插件。用于将 PDF 文档转换为 TIFF 格式。
[Obsolete("The class will be deleted soon. Please use PdfConverter class.")]
public static class TiffConverter
继承
object ←
TiffConverter
继承成员
方法
Process(PdfToTiffOptions)
将 PDF 文档转换为 TIFF 格式。
public static ResultContainer Process(PdfToTiffOptions options)
参数
返回值
ResultContainer :包含操作结果的对象。
异常
ArgumentException
如果未设置 options。
Class Timestamp
信息
表示 Documentize.Timestamp 插件。用于向文档添加时间戳。
[Obsolete("该类将很快被删除。请使用 PdfSecurity 类。")]
public static class Timestamp
继承
object ←
Timestamp
继承的成员
方法
Process(AddTimestampOptions)
使用指定的参数启动 Documentize.Timestamp 处理。
public static ResultContainer Process(AddTimestampOptions options)
参数
返回
ResultContainer:包含操作结果的对象。
异常
ArgumentException
如果未设置选项。
Class TimestampOptions
public class TimestampOptions
继承
object ←
TimestampOptions
继承的成员
构造函数
TimestampOptions(string, string)
初始化 Documentize.TimestampOptions 类的新实例。
public TimestampOptions(string serverUrl, string basicAuthCredentials = "")
参数
serverUrl string:时间戳服务器的 URL。basicAuthCredentials string:基础身份验证凭据,用户名和密码合并为字符串 "username:password"。
属性
BasicAuthCredentials
获取/设置基础身份验证凭据,用户名和密码合并为字符串 "username:password"。
public string BasicAuthCredentials { get; set; }
属性值
string
ServerUrl
获取/设置时间戳服务器的 URL。
public string ServerUrl { get; set; }
属性值
string
Class TocGenerator
信息
表示 Documentize.TocGenerator 插件。用于向 PDF 文档添加目录。
继承
object ←
TocGenerator
继承成员
示例
此示例演示如何向 PDF 文件添加目录。
// Create TocOptions object to set instructions
var options = new TocOptions();
// Set the Title
options.Title = "My Table of Contents";
// Design Headings
options.Headings.Add(new TocHeading("Introduction", 2));
options.Headings.Add(new TocHeading("Chapter I", 3));
options.Headings.Add(new TocHeading("Chapter II", 4));
options.Headings.Add(new TocHeading("Chapter III", 5));
// Add input file path
options.AddInput(new FileData("path_to_your_pdf_file.pdf"));
// Set output file path
options.AddOutput(new FileData("path_to_result_pdf_file.pdf"));
// Perform the process
TocGenerator.Process(options);
此示例演示如何在生成书签的同时向 PDF 文件添加目录。
// Create TocOptions object to set instructions
var options = new TocOptions();
// Set the Title
options.Title = "My Table of Contents";
// Generate links in bookmarks
options.GenerateBookmarks = true;
// Design Headings
options.Headings.Add(new TocHeading("Introduction", 2, false, 1));
options.Headings.Add(new TocHeading("Chapter I", 3, true, 1));
options.Headings.Add(new TocHeading("Chapter II", 4, true, 1));
options.Headings.Add(new TocHeading("Example A", 4, true, 2));
options.Headings.Add(new TocHeading("Example B", 4, true, 2));
options.Headings.Add(new TocHeading("Example C", 4, true, 2));
options.Headings.Add(new TocHeading("Example D", 4, true, 2));
options.Headings.Add(new TocHeading("Chapter III", 5, true, 1));
// Add input file path
options.AddInput(new FileData("path_to_your_pdf_file.pdf"));
// Set output file path
options.AddOutput(new FileData("path_to_result_pdf_file.pdf"));
// Perform the process
TocGenerator.Process(options);
此示例演示如何向 PDF 文件添加目录并保存为流。
// Create TocOptions object to set instructions
var options = new TocOptions();
// Set the Title
options.Title = "My Table of Contents";
// Design Headings
options.Headings.Add(new TocHeading("Introduction", 2, false, 1));
// Add input file path
options.AddInput(new FileData("path_to_your_pdf_file.pdf"));
// Set output stream
var outputStream = new MemoryStream();
options.AddOutput(new StreamData(outputStream));
options.CloseOutputStreams = false;
// Perform the process
TocGenerator.Process(options);
方法
Process(TocOptions)
使用指定参数启动 Documentize.TocGenerator 处理。
public static ResultContainer Process(TocOptions options)
参数
返回
ResultContainer:包含操作结果的 Documentize.ResultContainer 对象。
Class TocHeading
信息
表示由 Documentize.PdfManager 插件记录的目录(Table of Contents)标题或标题的选项。
Inheritance
object ←
TocHeading
Inherited Members
Constructors
TocHeading(string, int, bool, int)
初始化一个 Documentize.TocHeading 的新实例。
public TocHeading(string text = "", int pageNumber = 1, bool generateNumbering = false, int level = 1)
Parameters
text string: 标题的文本。pageNumber int: 链接的页码。generateNumbering bool: 是否使用编号生成。level int: 级别。
Properties
GenerateNumbering
是否使用编号生成。
如果为 true,则自动进行编号;否则,需要手动编号。
public bool GenerateNumbering { get; set; }
Property Value
bool
Level
级别。用于编号生成。
public int Level { get; set; }
Property Value
int
PageNumber
链接的页码。
public int PageNumber { get; set; }
Property Value
int
Text
标题的文本。
public string Text { get; set; }
Property Value
string
Class TocOptions
信息
表示使用 Documentize.PdfManager 插件向文档添加目录的选项。
public sealed class TocOptions : PluginBaseOptions, IPluginOptions
继承关系
object ←
PluginBaseOptions ←
TocOptions
实现接口
继承成员
构造函数
TocOptions()
使用默认选项初始化 Documentize.TocOptions 对象的实例。
属性
GenerateBookmarks
使用书签生成。
如果设置为 true,则书签将被清除并依据标题重新生成;否则书签保持不变。
public bool GenerateBookmarks { get; set; }
属性值
bool
Headings
目录的标题或章节。
public List<TocHeading> Headings { get; set; }
属性值
List<TocHeading> – List of TocHeading
Title
目录的标题。
public string Title { get; set; }
属性值
string
Class Usage
继承
object ←
Usage
继承的成员
构造函数
Usage()
属性
CompletionTokens
生成的补全中的标记数量。
[JsonProperty("completion_tokens")]
public int CompletionTokens { get; set; }
属性值
int
PromptTokens
提示中的标记数量。
[JsonProperty("prompt_tokens")]
public int PromptTokens { get; set; }
属性值
int
TotalTokens
请求中使用的标记总数(提示 + 补全)。
[JsonProperty("total_tokens")]
public int TotalTokens { get; set; }
属性值
int
Class XlsConverter
信息
表示 Documentize.XlsConverter 插件。用于将 PDF 文档转换为 XLSX/XLS/CSV/XLSM/ODS 格式。
[Obsolete("The class will be deleted soon. Please use PdfConverter class.")]
public static class XlsConverter
继承
object ←
XlsConverter
继承成员
方法
Process(PdfToXlsOptions)
将 PDF 文档转换为 XLSX/XLS/CSV/XLSM/ODS 格式。
public static ResultContainer Process(PdfToXlsOptions options)
参数
返回值
ResultContainer :包含操作结果的对象。
异常
ArgumentException
如果未设置 options。
Enum ConvertErrorAction
public enum ConvertErrorAction
Fields
Enum ConvertSoftMaskAction
public enum ConvertSoftMaskAction
Fields
ConvertToStencilMask = 1: 软遮罩将被转换为模板遮罩。Default = 0: 使用默认策略。
Enum DataType
Fields
Directory = 2: 数据类型是目录,由其路径表示。File = 0: 数据类型是文件,由其路径表示。Stream = 1: 数据类型是流。
Enum DocConversionMode
public enum DocConversionMode
Fields
Flow = 1: 完整识别模式,引擎执行分组和多层分析以恢复原始文档作者的意图,并生成可最大程度编辑的文档。缺点是输出文档可能看起来与原始 PDF 文件不同。TextBox = 0: 该模式快速且有助于最大程度保留 PDF 文件的原始外观,但生成文档的可编辑性可能受限。原始 PDF 文件中每个视觉上分组的文本块都会被转换为生成文档中的文本框。这实现了输出文档与原始 PDF 文件的最大相似度。输出文档看起来会很好,但它将完全由文本框组成,这可能会使在 Microsoft Word 中进一步编辑文档变得相当困难。这是默认模式。
public enum HtmlMediaType
Fields
Print = 0: 打印。Screen = 1: 屏幕。
Enum HtmlPageLayoutOption
信息
指定一组标志,这些标志与其他选项一起决定页面的尺寸和布局。
public enum HtmlPageLayoutOption
Fields
FitToWidestContentWidth = 3: 表示页面宽度由内容本身的大小决定,而不是由指定的页面宽度决定。None = 0: 默认值,表示 HtmlPageLayoutOption 不会影响页面的尺寸和布局。ScaleToPageWidth = 256: 表示文档内容将按比例缩放以适应页面宽度。
Enum PdfAStandardVersion
public enum PdfAStandardVersion
Fields
Auto = 0: PDF/A 标准版本将自动确定。PDF_A_1A = 1: 指定 PDF/A-1a 标准版本。PDF_A_1B = 2: 指定 PDF/A-1b 标准版本。PDF_A_2A = 3: 指定 PDF/A-2a 标准版本。PDF_A_2B = 4: 指定 PDF/A-2b 标准版本。PDF_A_2U = 5: 指定 PDF/A-2u 标准版本。PDF_A_3A = 6: 指定 PDF/A-3a 标准版本。PDF_A_3B = 7: 指定 PDF/A-3b 标准版本。PDF_A_3U = 8: 指定 PDF/A-3u 标准版本。
Enum PdfToHtmlOptions.SaveDataType
public enum PdfToHtmlOptions.SaveDataType
Fields
FileWithEmbeddedResources = 1: 将 HTML 保存为带嵌入资源的文件FileWithExternalResources = 0: 将 HTML 保存为带外部资源的文件StreamWithEmbeddedResources = 2: 将 HTML 保存为带嵌入资源的文件流
信息
允许指定 xls/xlsx/xml/csv 文件格式。默认值为 XLSX。
允许指定 xls/xlsx/xml/csv 文件格式。
默认值为 XLSX。
public enum PdfToXlsOptions.ExcelFormat
Fields
CSV = 2: 逗号分隔值(.csv)文件格式。ODS = 4: 开放文档电子表格。XLSM = 3: 含宏的 Office Open XML(.xlsm)文件格式。XLSX = 1: Office Open XML(.xlsx)文件格式。XMLSpreadSheet2003 = 0: Excel 2003 XML(.xls)文件格式。
Enum Role
字段
Assistant = 2System = 1User = 0
Enum Rotation
Fields
None = 0: 未旋转。On180 = 2: 旋转 180 度。On270 = 3: 顺时针旋转 270 度。On360 = 4: 顺时针旋转 360 度。On90 = 1: 顺时针旋转 90 度。
Enum TextFormattingMode
信息
定义在将 PDF 文档转换为文本时可使用的不同模式。参见 Documentize.ExtractTextOptions 类。
public enum TextFormattingMode
Fields
Flatten = 2: 通过其坐标将 PDF 内容表示为定位的文本片段。基本上类似于 “Raw” 模式。但 “Raw” 侧重于保留文档中文本片段(操作符)的结构,而 “Flatten” 则侧重于保持文本的阅读顺序。Pure = 0: 使用少量格式化例程表示 PDF 文本内容。这包括考虑相对位置并添加额外空格以对齐文本到页面宽度。Raw = 1: 按原样表示 PDF 内容,即不进行格式化。
Enum TiffColorDepth
信息
用于指定 Documentize.PdfToTiffOptions 的颜色深度。
public enum TiffColorDepth
Fields
Format1bpp = 4: 每像素 1 位。Format24bpp = 1: 每像素 24 位。RGB。Format32bpp = 0: 每像素 32 位。默认使用。Format4bpp = 3: 每像素 4 位。Format8bpp = 2: 每像素 8 位。
Enum TiffCompression
信息
用于指定 Documentize.PdfToTiffOptions 的压缩类型。
public enum TiffCompression
Fields
CCITT3 = 2: 指定 CCITT3 压缩方案。可以作为属于 Compression 类别的参数传递给 CCITT3 编码器。CCITT4 = 1: 指定 CCITT4 压缩方案。可以作为属于 Compression 类别的参数传递给 CCITT4 编码器。LZW = 0: 指定 LZW 压缩方案。可以作为属于 Compression 类别的参数传递给 Tiff 编码器。None = 4: 指定不压缩。可以作为属于 Compression 类别的参数传递给 Tiff 编码器。RLE = 3: 指定 RLE 压缩方案。可以作为属于 Compression 类别的参数传递给 RLE 编码器。
Interface IData
public interface IData
{
}
Properties
DataType
数据源的类型。
DataType DataType { get; }
Property Value
DataType
public interface IHaveInput
属性
获取或设置输入数据。
IData Input { get; set; }
属性值
IData
Interface IOperationResult
信息
定义通用操作结果接口,规定具体组件操作结果应实现的公共方法。
public interface IOperationResult
属性
Data
获取原始数据。
属性值
object
IsFile
指示结果是否为输出文件的路径。
属性值
bool
IsStream
指示结果是否为输出流。
属性值
bool
IsString
指示结果是否为文本字符串。
属性值
bool
方法
ToFile()
尝试将结果转换为文件。
返回值
string :如果结果是文件,则返回表示输出文件路径的字符串;否则返回 null。
ToStream()
尝试将结果转换为流对象。
返回值
Stream :如果结果是流,则返回表示输出数据的流对象;否则返回 null。
Interface IPluginOptions
信息
通用组件选项接口,定义具体组件选项应实现的公共方法。
public interface IPluginOptions
接口 IDataSource
public interface IDataSource
属性
DataType
数据源的类型。
DataType DataType { get; }
属性值
DataType
信息
定义在将 PDF 文档转换为文本时可以使用的不同模式。请参见 Documentize.TextExtractorOptions 类。
public enum TextExtractorOptions.TextFormattingMode
Fields
Plain = 2: 表示 PDF 文本内容,考虑文本片段的相对位置,但不添加额外空格。Pure = 0: 表示带有少量格式化例程的 PDF 文本内容。这包括考虑相对位置并添加额外空格以使文本对齐到页面宽度。Raw = 1: 表示 PDF 内容,原样输出,即不进行格式化。