Skip to content
全新发布

PDF SDK 与 AI 文档处理

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

删除表单域

由于表单继承自注释类,所以删除表单域和删除注释的方法一致。

删除表单域的步骤如下:

  1. 从 CPDFDocument 中获取想要删除表单的页面对象。

  2. 删除表单域。

以下是删除指定文档中第一个注释的示例代码:

swift
var document = CPDFDocument(url: URL(string: "filePath"))
let page = document?.page(at: 0)

let annotation = page?.annotations[0]
page?.removeAnnotation(annotation)
objective-c
CPDFDocument *document = [[CPDFDocument alloc] initWithURL:[NSURL fileURLWithPath:@"filePath"]];
CPDFPage *page = [document pageAtIndex:0];

CPDFAnnotation *annotation = [[page annotations] objectAtIndex:0];
[page removeAnnotation:annotation];