We’re pleased to announce the release of GroupDocs.Parser for .NET 26.7, available as of July 2026.
What’s new in this release
| 键 | 摘要 | 类别 |
|---|---|---|
| PARSERNET-2890 | 实现从 PDF 文档中提取注释的功能 | 改进 |
| PARSERNET-2891 | 为 .NET 6、.NET 8、.NET 10 实现 NuGet 包 | 改进 |
公共 API 更改
实现从 PDF 文档中提取注释的功能
已在 GroupDocs.Parser.Data 命名空间中添加了 AnnotationItem 类。
已在 GroupDocs.Parser.Data.AnnotationItem 类中添加了属性 System.String Value。
已在 GroupDocs.Parser.Options.Features 类中添加了属性 Boolean Annotations。
已在 GroupDocs.Parser.Options.TextOptions 类中添加了属性 Boolean IncludeAnnotations。
已在 GroupDocs.Parser.Parser 类中添加了方法 System.Collections.Generic.IEnumerable<GroupDocs.Parser.Data.AnnotationItem> GetAnnotations()。
已在 GroupDocs.Parser.Parser 类中添加了方法 System.Collections.Generic.IEnumerable<GroupDocs.Parser.Data.AnnotationItem> GetAnnotations(Int32)。
为 .NET 6、.NET 8、.NET 10 实现 NuGet 包
公共 API 更改:无。
代码示例
同时提取注释和完整文本
using (Parser parser = new Parser("C:\\MyDocuments\\MyFile.pdf"))
{
TextOptions options = new TextOptions()
{
IncludeAnnotations = true
};
using (TextReader reader = parser.GetText(options))
{
string text = reader.ReadToEnd();
Console.WriteLine(text);
}
}
单独提取注释
using (Parser parser = new Parser("C:\\MyDocuments\\MyFile.pdf"))
{
IEnumerable<AnnotationItem> annotations = parser.GetAnnotations();
foreach (AnnotationItem annotation in annotations)
{
Console.WriteLine(annotation.Value);
}
}
}
如何获取更新
NuGet
- .NET Framework 4.6.2 package
- .NET Standard 2.1 package
- .NET 6 package
- .NET 8 package
- .NET 10 package
安装路由包 — 它会自动为您的平台选择合适的包: