https://github.com/r0mb0/htmls_to_pdfs
Batch convert HTML files to PDF using PowerShell and wkhtmltopdf. Automatically processes all HTML files in a folder and saves the PDFs in an output directory.
https://github.com/r0mb0/htmls_to_pdfs
convert-html-2-pdf convert-html-pdf convert-html-to-pdf html italian-developers pdf powershell powershell-script r0mb0
Last synced: 5 months ago
JSON representation
Batch convert HTML files to PDF using PowerShell and wkhtmltopdf. Automatically processes all HTML files in a folder and saves the PDFs in an output directory.
- Host: GitHub
- URL: https://github.com/r0mb0/htmls_to_pdfs
- Owner: R0mb0
- License: mit
- Created: 2025-08-05T15:11:21.000Z (7 months ago)
- Default Branch: main
- Last Pushed: 2025-09-17T08:47:39.000Z (5 months ago)
- Last Synced: 2025-10-01T23:57:21.977Z (5 months ago)
- Topics: convert-html-2-pdf, convert-html-pdf, convert-html-to-pdf, html, italian-developers, pdf, powershell, powershell-script, r0mb0
- Language: PowerShell
- Homepage:
- Size: 14.6 KB
- Stars: 0
- Watchers: 0
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Contributing: CONTRIBUTING.md
- Funding: .github/FUNDING.yml
- License: LICENSE
- Code of conduct: CODE_OF_CONDUCT.md
- Security: SECURITY.md
- Support: SUPPORT.md
Awesome Lists containing this project
README
# HTMLs to PDFs
[](https://app.codacy.com/gh/R0mb0/HTMLs_to_PDFs/dashboard?utm_source=gh&utm_medium=referral&utm_content=&utm_campaign=Badge_grade)
[](https://github.com/R0mb0/HTMLs_to_PDFs)
[](https://github.com/R0mb0/HTMLs_to_PDFs)
[](https://opensource.org/license/mit)
[](http://paypal.me/R0mb0)
Batch convert HTML files to PDF using PowerShell and wkhtmltopdf.
This script automatically processes all HTML files in its folder and saves the converted PDFs in an `output` directory.
## Features
- Converts all `.html` files in the script’s directory to PDF
- Uses [wkhtmltopdf](https://wkhtmltopdf.org/) for high-quality PDF generation
- Output PDFs are stored in an organized `output` folder
- Optimized conversion settings: A4, landscape, no smart shrinking
## Prerequisites
- [wkhtmltopdf](https://wkhtmltopdf.org/) installed and available in your system PATH, or know its full path
## Usage
1. **Download or clone this repository.**
2. **Place the PowerShell script in the folder containing your `.html` files.**
3. **Open PowerShell in that folder.**
4. (Optional, if you encounter execution policy errors) Run:
```powershell
Set-ExecutionPolicy -Scope Process -ExecutionPolicy Bypass
```
This temporarily allows script execution for this PowerShell session only.
5. **Run the script:**
```powershell
.\convert-html-to-pdf.ps1
```
- PDFs will appear in the `output` subfolder.
## Script Customization
- If `wkhtmltopdf.exe` is not in your PATH, edit the line in the script:
```powershell
$wkhtmltopdf = "C:\Path\To\wkhtmltopdf.exe"
```