PDF 生成模板编辑器
开源可视化 PDF 生成引擎,支持自定义模板,并提供面向开发者的 API,灵活构建文档生成流程。
获取注释列表和注释对象的步骤如下:
以下是对应的代码:
var annotations: [CPDFAnnotation] = []
// 遍历所有页面
for i in 0..<document?.pageCount {
if let page = document.page(at: i) {
// 遍历页面的所有注释
annotations.append(contentsOf: page.annotations)
for annotation in annotations {
// 处理每个注释
}
}
}NSMutableArray *annotations = [NSMutableArray array];
// 遍历所有页面
for (int i=0; i<document.pageCount; i++) {
CPDFPage *page = [document pageAtIndex:i];
// 遍历页面的所有注释
[annotations addObjectsFromArray:[page annotations]];
for (CPDFAnnotation *annotation in annotations) {
}
}