Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
$sourceFile = "" # the source file containing the URLs you want to convert
$destFolder = "" # converted PDFs will be saved here. Folder has to exist.
$num = 1
foreach($link in [System.IO.File]::ReadLines($sourceFile))
{
$outfile = $num.ToString() + '.pdf'
& 'C:\Program Files\Google\Chrome\Application\chrome.exe' --headless --print-to-pdf="$destFolder $outfile" "$link"
Start-Sleep -s 3
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment