メインコンテンツにスキップ

savePDF

現在のブラウジングコンテキストのページを、お使いのOS上のPDFファイルに出力します。

使い方
browser.savePDF(filepath, { orientation, scale, background, width, height, top, bottom, left, right, shrinkToFit, pageRanges })
パラメータ
名前詳細
filepath文字列生成されたPDFへのパス(.pdfサフィックスは必須)実行ディレクトリからの相対パス
options
オプション
PDFPrintOptionsPDF出力オプション
options.orientation
オプション
文字列PDFページの向き
options.scale
オプション
数値PDFページのスケール
options.background
オプション
真偽値PDFページの背景を含める
options.width
オプション
数値PDFページの幅
options.height
オプション
数値PDFページの高さ
options.top
オプション
数値PDFページの上部パディング
options.bottom
オプション
数値PDFページの下部パディング
options.left
オプション
数値PDFページの左パディング
options.right
オプション
数値PDFページの右パディング
options.shrinkToFit
オプション
真偽値ページをページに合わせて縮小する
options.pageRanges配列[オブジェクト]PDFに含めるページの範囲
savePDF.js
it('should save a PDF screenshot of the browser view', function () {
await browser.savePDF('./some/path/screenshot.pdf');
});

ようこそ!何かお手伝いできることはありますか?

WebdriverIO AI Copilot