0
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 1 year has passed since last update.

【備忘録】Headless Chrome コマンドラインからHPをPDF保存する方法

Posted at

サンプル

start chrome.exe --headless --no-pdf-header-footer --print-to-pdf=c:\Qitta.pdf "https://qiita.com/"


保存先はフルパスでファイル名を書くこと!  >>> --print-to-pdf=c:\Qitta.pdf

startの要不要。chromeをフルパスで書くかとかは自分の環境で確認する。

下記項目はChromeのバージョン違いやEdge等ブラウザーの差異で要不要、(旧)の方しか使えなかったりするらしい。この辺はその都度、力業で確認する事。

--disable-gpu
--no-sandbox
--no-margins
--no-pdf-header-footer or --print-to-pdf-no-header (旧) 


参考資料:

0
1
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?