v26.10
更改的 PdfProperties 字段
- 字段 Created 为
DateTime(而非DateTime?)。如果文档没有该值,则返回DateTime.MinValue。 - 字段 Modified 为
DateTime(而非DateTime?)。如果文档没有该值,则返回DateTime.MinValue。
示例用法:
该示例演示如何从 PDF 文件中提取属性(Created、Modified)。
// Create ExtractPropertiesOptions object to set input file
var options = new ExtractPropertiesOptions("path_to_your_pdf_file.pdf");
// Perform the process and get Properties
var pdfProperties = PdfExtractor.Extract(options);
var created = pdfProperties.Created;
var modified = pdfProperties.Modified;为 GetFieldNamesOptions 添加空构造函数
在循环操作中使用时无需每次创建新实例,十分方便。
示例用法:
var options = new GetFieldNamesOptions();
// Set input from a file
options.Input = new FileData("path_to_your_pdf_file.pdf");
// Or set input from a stream
// options.Input = new StreamData(stream);
var results = PdfForm.GetNames(options);移除类 Splitter
- 之前的插件实现正逐步淘汰。该类的功能已由 PdfManager 替代。
- Class Splitter:已移除,请使用 PdfManager。
示例用法(保存为文件):
该示例演示如何将 PDF 流拆分为单页并保存为文件。
// Create SplitOptions object to set instructions
var options = new SplitOptions();
// Add input file path
options.AddInput(new FileData("path_to_your_pdf_file.pdf"));
// Set output file paths
options.AddOutput(new FileData("path_to_result_pdf_file_1.pdf"));
options.AddOutput(new FileData("path_to_result_pdf_file_2.pdf"));
// Perform the process
PdfManager.Split(options);示例用法(保存为流):
该示例演示如何将 PDF 流拆分为单页并保存为流。
// Prepare input and output streams
using var inputStream = File.OpenRead("path_to_your_pdf_file.pdf");
using var outputStream1 = new MemoryStream();
using var outputStream2 = new MemoryStream();
// Create SplitOptions object to set instructions
var options = new SplitOptions();
// Add input stream
options.AddInput(inputStream);
// Set output streams
options.AddOutput(outputStream1);
options.AddOutput(outputStream2);
// Prevent the closing of output streams
options.CloseOutputStreams = false;
// Perform the process
PdfManager.Split(options);移除类 Merger
- 之前的插件实现正逐步淘汰。该类的功能已由 PdfManager 替代。
- Class Merger:已移除,请使用 PdfManager。
示例用法:
该示例演示如何合并两个 PDF 文档。
// Create MergeOptions object to set instructions
var options = new MergeOptions();
// Add input file paths
options.AddInput(new FileData("path_to_your_pdf_file_1.pdf"));
options.AddInput(new FileData("path_to_your_pdf_file_2.pdf"));
// Set output file path
options.AddOutput(new FileData("path_to_result_pdf_file.pdf"));
// Perform the process
PdfManager.Merge(options);其他修复
🖥️ HTML 转 PDF
- 修复大量表格导致转换耗时过长的问题
- 修复在 Chrome 中 HTML 转 PDF 输出不正确的情况
- 修复 HTML 转 PDF 时表格文本内容缺失的问题
🌐 PDF 转 HTML
- 修复 PDF 转 HTML 时文本和图形内容缺失的问题
- 修复 PDF 转 HTML 时页脚徽标显示错误的问题
📄 PDF 转 DOC/XLS
- 修复 PDF 转 DOC 转换耗时过长的问题
- 修复 PDF 转 Excel 时输出不正确的问题
🖼️ PDF 转 PNG
- 修复 PDF 转 PNG 时首页文字失真的问题
- 修复 PDF 转 PNG 抛出
InvalidOperationException的问题
🖼️ PDF 转 TIFF
- 修复 PDF 转 TIFF 时未转换全部页面的问题
- 修复 PDF 转 TIFF 时生成全黑图像的问题
📑 PDF 转 PDF/A
- 修复 PDF 转 PDF/A 时输出中出现白色符号的问题
- 修复 PDF 转 PDF/A 时矩形边框颜色改变的问题
- 修复 PDF/A‑1b 输出未通过预检合规性测试的问题
- 修复 PDF/A 转换生成无效的 UTF‑8 BaseFont 的问题
- 修复 PDF/A 转换导致可见文字变化的问题
- 修复 PDF/A‑2b 转换抛出
ArgumentOutOfRangeException的问题 - 修复 PDF/A‑2b 转换抛出
NullReferenceException的问题
📄 文档操作
- 修复 PDF 合并时因无效键导致抛出
ArgumentException的问题 - 修复扁平化字段导致文字方向改变的问题
- 修复 PDF 文档中文本提取不正确的问题