PDF 生成模板编辑器
开源可视化 PDF 生成引擎,支持自定义模板,并提供面向开发者的 API,灵活构建文档生成流程。
设置显示 PDF 文档的默认缩放因子,默认为 1.0,限制范围为 1.0 到 5.0。
CPDFReaderWidgetController? _controller;
Scaffold(
resizeToAvoidBottomInset: false,
appBar: AppBar(),
body: CPDFReaderWidget(
document: documentPath,
configuration: CPDFConfiguration(
readerViewConfig: const ReaderViewConfig(pageScale: 1.0)),
onCreated: (controller) {
setState(() {
this._controller = controller;
});
},
));通过CPDFReaderWidgetController设置缩放:
_controller.setScale(1.0);双击缩放
自 2.6.0 版本起,支持通过双击手势快速缩放页面。此功能可通过 CPDFConfiguration 启用:
CPDFConfiguration(
readerViewConfig: CPDFReaderViewConfig(
enableDoubleTapZoom: true
)
)