v24.12
新增插件:PDF 转 PNG 转换器
- 类 PngConverter:表示 Documentize.PngConverter 插件。用于将 PDF 文档转换为 PNG 格式。
- 类 PdfToPngOptions:表示 Documentize.PngConverter 插件的 PDF 到 PNG 转换选项。
示例用法:
// 创建 PngConverter
var plugin = new PngConverter();
// 创建 PdfToPngOptions 对象以设置指令
var opt = new PdfToPngOptions();
// 添加输入文件路径
opt.AddInput(new FileDataSource("path_to_your_pdf_file.pdf"));
// 设置输出文件路径
opt.AddOutput(new DirectoryDataSource("path_to_results_directory"));
// 执行处理
plugin.Process(opt);
新增插件:PDF 转 TIFF 转换器
- 类 TiffConverter:表示 Documentize.TiffConverter 插件。用于将 PDF 文档转换为 TIFF 格式。
- 类 PdfToTiffOptions:表示 Documentize.TiffConverter 插件的 PDF 到 TIFF 转换选项。
示例用法:
// 创建 TiffConverter
var plugin = new TiffConverter();
// 创建 PdfToTiffOptions 对象以设置指令
var opt = new PdfToTiffOptions();
// 添加输入文件路径
opt.AddInput(new FileDataSource("path_to_your_pdf_file.pdf"));
// 设置输出文件路径
opt.AddOutput(new DirectoryDataSource("path_to_results_directory"));
// 执行处理
plugin.Process(opt);
新增插件:PDF 表格生成器
- 类 TableGenerator:表示 Documentize.TableGenerator 插件。用于向 PDF 文档添加表格。
- 类 TableBuilder:表示 PDF 页面中表格的构建器的类。
- 类 TableRowBuilder:表示表格行的构建器的类。
- 类 TableCellBuilder:表示表格单元格的构建器的类。
示例用法:
// 创建 TableGenerator
var plugin = new TableGenerator();
// 创建 TableOptions 对象以设置指令
TableOptions opt = new TableOptions().InsertPageBefore(1)
.AddTable()
.AddRow()
.AddCell().AddParagraph("名称")
.AddCell().AddParagraph("年龄")
.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");
// 添加输入文件路径
opt.AddInput(new FileDataSource("path_to_your_pdf_file.pdf"));
// 设置输出文件路径
opt.AddOutput(new FileDataSource("path_to_the_converted_file.pdf"));
// 执行处理
plugin.Process(opt);
将类 PdfDoc 重命名为 DocConverter
- 类 DocConverter:表示 Documentize.DocConverter 插件。用于将 PDF 文档转换为 DOC/DOCX 格式。
示例用法:
// 创建 DocConverter
var plugin = new DocConverter();
// 创建 PdfToDocOptions 对象以设置指令
var opt = new PdfToDocOptions();
// 添加输入文件路径
opt.AddInput(new FileDataSource(inputPath));
// 设置输出文件路径
opt.AddOutput(new FileDataSource(outputPath));
// 执行处理
plugin.Process(opt);