The post that @Deenuji references explains how to do it via the user interface, which, I think is not very efficient. I would recommend using a script, such as PowerShell or VBScript to print to PDF. It's quite straightforward. Here's a sample PowerShell script you could use: https://www.powershellgallery.com/packages/WienExpertsLive/1.14/Content/Out-PDFFile.ps1 (a bit of an overkill though, as it installs the Microsoft PDF Printer, which is not needed, really, as you should already have it with Windows).
Or you could just use the following PowerShell script to use a "headless" instance of Chrome to print it to PDF:
Start-Process -FilePath "C:\Program Files\Google\Chrome\Application\chrome.exe" -ArgumentList "--headless --disable-gpu --print-to-pdf=`"{PDFFilePath}`" `"file:///{ImageFilePath}`""
Note you need to replace the placeholders with actual file paths.