HTML 要素を画像化した複数のファイルをローカルの専用サーバーに送って保存します。 シリーズの記事です。 dom-to-imageを試す html2canvasを試す 複数の画像を生成してローカルに保存 ← 今回の記事 ライブラリ 前回まで同じ目的の2つのライブラリを比較しました。どちらも Firefox では文字サイズが変わってレイアウトが崩れるため、今回は Chrome を前提に進めます。 テキストだけを含む要素の画像化ではどちらを使ってもほとんど差がありませんでした。XMLHttpRequest でファイルを送るには Blob に変換する必要があるため、その機能をサポートしている dom-to-image を使用します。 HTML 要素を画像化した Blob の生成は簡単にできます。 サーバー 以下の記事で作ったファイルを受け取るサーバー (server.ts) を使用します。 簡