PDF 生成模板编辑器
开源可视化 PDF 生成引擎,支持自定义模板,并提供面向开发者的 API,灵活构建文档生成流程。
由于表单继承自注释类,所以删除表单域和删除注释的方法一致。
删除表单域的步骤如下:
从 CPDFDocument 中获取想要删除表单的页面对象。
删除表单域。
以下是删除指定文档中第一个注释的示例代码:
var document = CPDFDocument(url: URL(string: "filePath"))
let page = document?.page(at: 0)
let annotation = page?.annotations[0]
page?.removeAnnotation(annotation)CPDFDocument *document = [[CPDFDocument alloc] initWithURL:[NSURL fileURLWithPath:@"filePath"]];
CPDFPage *page = [document pageAtIndex:0];
CPDFAnnotation *annotation = [[page annotations] objectAtIndex:0];
[page removeAnnotation:annotation];