savePDF
現在のブラウジングコンテキストのページを、お使いのOS上のPDFファイルに出力します。
使い方
browser.savePDF(filepath, { orientation, scale, background, width, height, top, bottom, left, right, shrinkToFit, pageRanges })
パラメータ
| 名前 | 型 | 詳細 |
|---|---|---|
filepath | 文字列 | 生成されたPDFへのパス(.pdfサフィックスは必須)実行ディレクトリからの相対パス |
optionsオプション | PDFPrintOptions | PDF出力オプション |
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');
});