Guides
渲染注释外观
ComPDF Flutter SDK 支持通过 API 渲染注释外观。当您创建或修改注释后,可以调用以下方法获取 Ink、图章、图片等注释类型的外观图像:
dart
final annotations = await document.pageAtIndex(0).getAnnotations();
final annotation = annotations.first;
final imageBytes = await document.renderAnnotationAppearance(
annotation,
options: const CPDFAnnotationRenderOptions(scale: 4.0),
);
// imageBytes 是一个 Uint8List 对象,包含注释外观的图像数据,可将其转换为 Flutter 的 Image 组件进行显示