0

Is there a tool or a program for Windows with which I can convert a lot of HTML files (approx. 3000) into individual PDF files?

I can only find requests for a single PDF everywhere, but I need to convert each HTML file into exactly one PDF file.

0

1 Answer 1

1

Yes. In Windows there's a command line solution you can use, wkhtmltopdf. Download here. Make sure installation directory is on path.

Or if you have chocolatey installed, you don't have to worry about adding it to path because chocolatey will do it for you. Just open an admin CMD shell and type:

choco install wkhtmltopdf

Then navigate to the folder that has your HTML files and create a new text document. Input the following and save it as convert.bat.

@echo off
for %%x in (*.html) do wkhtmltopdf "%%x" "%%~nx.pdf"

Just remember, if you are using the GUI with notepad when creating a new text file, when saving the file, go to file, save as, and change the type to 'all files' and then use the file name with the bat extension, convert.bat

You can then double click this batch file located in directory of your HTML files and they will be converted to PDF.

4
  • Please don't answer off-topic questions.
    – DavidPostill
    Commented Nov 30, 2023 at 21:11
  • Okay sorry it wasn't off topic when I first answered it. Commented Nov 30, 2023 at 21:12
  • Yes it was. It just wasn't closed as such.
    – DavidPostill
    Commented Nov 30, 2023 at 21:19
  • cut me slack, new guy dude. it popped up as the first suggestion when i was trying to earn points. Commented Dec 1, 2023 at 5:20

Not the answer you're looking for? Browse other questions tagged .