Time changes abilities so modern Windows includes Chromium based MS Edge without needing to install a duplicate Chrome suite.
UPDATE Autumn 2024
The headless ability has been changed by Chromium team to a separate executable "Chrome-Headless-Shell" this impacts both MSEdge and chrome users. Needing "migration" to headless shell for version 128 onwards!
For my suggestion as to how to download and run headless shell see
https://stackoverflow.com/a/76079607/10802527
OLD answer
Still relevant as to how to use Landscape inside HTML
And over time many switches have been updated or changed. So disabling the GPU was not required after 2018. Also "New" is now the default so not needed either, but header and footer margin controls have also changed.
Basically use
"c:\ path to \MSedge.exe" --headless --no-pdf-header-footer --print-to-pdf="C:\ path \filename.pdf" "drive:\Folder\filename.html"
Note: There cannot (in the command line) be any attempt to alter the internal Media/CSS to Landscape it must be done by edits inside the HTML.
However, additional switches may help with timing so one example is --run-all-compositor-stages-before-draw
For my example of HTML edit, to switch the content to landscape, we can add in the HTML head style, for A4 Landscape:
<head>
<meta http-equiv="Content-Style-Type" content="text/css">
<style>@media print { @page { margin: 0; size: 842pt 595pt ; } body { margin: 0; } }</style>
</head>
Taking this SuperUser page at default it will be "portrait".

However by adding my style over-ride inside the HTML it will become "landscape". (NOTE: There were oddly 3 x entries so I simply added that find and replace line a total of 3 times for overkill).

"chrome-headless-shell.exe" --no-pdf-header-footer --print-to-pdf="%cd%\landscape.pdf" "%cd%\command line headless options - Super User.html"
