PDF 生成模板编辑器
开源可视化 PDF 生成引擎,支持自定义模板,并提供面向开发者的 API,灵活构建文档生成流程。
获取并编辑已添加表单域的外观和内容。
需要注意,不同的表单域类型,允许设置的属性可能不完全一致。
编辑表单域的步骤如下:
取得需要编辑的表单对象。
修改表单域属性。
更新表单域外观。
以下是编辑表单域的代码:
if let widgetAnnotation = annotation as? CPDFWidgetAnnotation {
if let textWidget = widgetAnnotation as? CPDFTextWidgetAnnotation {
textWidget.stringValue = "text"
textWidget.updateAppearanceStream()
}
}CPDFWidgetAnnotation * annotation = (CPDFWidgetAnnotation *)myAnnotation;
((CPDFTextWidgetAnnotation*)annotation).stringValue = "text"
[annotation updateAppearanceStream];