跳至正文

打印 WebView

为当前 WebView 内容显示系统打印界面,仅适用于 Android 和 iOS。请在安装后调用。在按钮处理程序中即可快速验证系统打印界面,无需外部文件。如需打印 PDF 或其他文件,请参阅打印 PDF 和文件。

import { Printer } from '@rdlabo/capacitor-printer';

await Printer.printWebView({ name: 'Document' });

name 是打印任务名称,默认为 'Document'。

method printWebView(...)

展示打印界面以打印 Web 视图内容。

printWebView(options?: PrintOptions | undefined) => Promise<void>

type alias PrintWebViewOptions

PrintOptions