The whole task can be done in one command line in Windows without chrome dev or selenium/playwright and whilst MSEdge v141 currently has some problems running headless, Chrome-Headless-Shell is the preferred chromium team suggestion.
To use current MS Edge without any other app you need this format
start msedge --headless=new --user-data-dir="%cd%\temp" --log-level=3 --run-all-compositor-stages-before-draw --virtual-time-budget=80000 --no-pdf-header-footer --generate-pdf-document-outline --print-to-pdf="%cd%\out.pdf" "in.html"

"%~dp0chrome-headless-shell.exe" --generate-pdf-document-outline --run-all-compositor-stages-before-draw --virtual-time-budget=80000 --no-pdf-header-footer --print-to-pdf="%~dpn1.pdf" "%~1"
pause
You can just like LaTeX use SumatraPDf to show HTML text edits live* then press one key to convert live HTML view to live preview of PDF result. So, 1 x MS Notepad and 2 SumatraPDF previews with Chrome-headless-shell or Edge would do it.
- SumatraPDF does have limitations when viewing more complex HTM (unless in simple ePub format), but good for small simple files either local or on the web.
Helper script to download and unpack chrome headless 32 into a work folder.
Part of a suite of my fetchers
:: Create working directory as required & fetch binary
echo No chrome-headless-shell found. Fetching binary
md "%~dp0..\CHShell"
cd /d "%~dp0..\CHShell"
set "download=chrome-headless-shell-win32"
set "variant=win32/%download%.zip"
curl -o LATEST_RELEASE_STABLE.txt https://googlechromelabs.github.io/chrome-for-testing/LATEST_RELEASE_STABLE
set /p version=<LATEST_RELEASE_STABLE.txt
curl -O https://storage.googleapis.com/chrome-for-testing-public/%version%/%variant%
tar -xf "%download%.zip"
xcopy /E /H /K /Y %download% %cd%
rd /s /q %download%
:: Verify
if exist "chrome-headless-shell.exe" (
echo chrome-headless-shell downloaded successfully.
REM for debug test pause
exit /b 0
) else (
echo ERROR: chrome-headless-shell.exe not found.
pause & exit /b 1
)
outlineoption playwright.dev/python/docs/api/…?page.pdf(outline=True, tagged=True)