Skip to content
全新发布

PDF SDK 与 AI 文档处理

在 GitHub 获取完整的私有化部署SDK 包及 AI 智能文档处理能力,一键部署,快速构建您的文档处理工作流。

获取注释

获取注释列表和注释对象的步骤如下:

  1. 获取页面对象。
  2. 取得页面对象中的注释列表。
  3. 遍历列表中的每一个注释对象。

以下是对应的代码:

C#
CPDFDocument document = CPDFDocument.InitWithFilePath("filePath");
int pageCount = document.PageCount;
if(pageCount>0)
{
    for(int pageIndex = 0;pageIndex < pageCount;pageIndex++)
    {
    	// 取得页面对象,并在页面对象中取得注释列表
        List<CPDFAnnotation>annotations = document.PageAtIndex(pageIndex).GetAnnotations();
        if(annotations != null && annotations.Count != 0)
        {
          // 遍历列表中的每一个注释对象
          foreach(CPDFAnnotation annotation in annotations)
          {
            //  对获取到的注释对象进行相关操作。
          }
      	}
    }
}