Logo
Home Products Support Contact About Us
arrow1 File Converters
arrow1 TIFF and PDF apps
arrow1 Forensic
arrow1 Freeware

Convert HTML to PDF via Command Line — Server Batch Converter

You have hundreds of HTML files or saved web pages on a server that need to become PDFs — for archiving, for offline distribution, or for a workflow that delivers printable documents to end users. Opening each file in a browser and printing to PDF does not scale. Total HTML Converter X converts HTML files to PDF from the command line, in batch, with no GUI and no browser installation. Install it on a Windows server, call it from a script or via ActiveX, and let it run unattended.

What Total HTML Converter X Does

  • Batch conversion — pass a wildcard (*.html) and the converter processes every matching file in one run
  • PDF security — set user and owner passwords, restrict printing, prevent text copying, add digital signatures
  • Watermarks — stamp text or image watermarks on every page during conversion
  • CSS rendering — recognizes all HTML tags, CSS 1 and CSS 2 styles, inline images, and tables
  • Page layout control — set paper size, orientation, margins, and auto-fit HTML width to the PDF page
  • No GUI — runs silently from the command line with no pop-up windows or confirmation dialogs
  • ActiveX / COM — call the converter from .NET, VBScript, PHP, Python, or any COM-compatible environment to embed conversion into your own application
  • .bat scripting — save commands in batch files and schedule them with Windows Task Scheduler for fully automated conversion

HTML to PDF command line conversion

Download Free Trial
(includes 30-day trial — no email required)

Windows 7/8/10/11 • Server 2008/2012/2016/2019/2022

HTML vs PDF: Why Convert?

HTML is a markup language designed for web browsers. An HTML file can reference external stylesheets, images, and scripts that may not be available offline. Rendering depends on the browser engine, installed fonts, and screen size. An HTML page printed from Chrome can look different from the same page printed from Firefox or Edge.

PDF is a fixed-layout format that looks identical on every device. It preserves fonts, images, and layout exactly as intended. PDF files can be password-protected, digitally signed, and restricted against editing or printing. They open natively in every browser, mobile OS, and desktop operating system without an internet connection.

HTMLPDF
RenderingVaries by browser and screen sizeIdentical on every device
Offline accessMay depend on external resourcesSelf-contained, fully offline
EditabilityEditable source codeRead-only (by design)
SecurityNo built-in protectionPasswords, encryption, permissions
PrintingResults vary by browserConsistent, print-ready output
Use caseWeb display, dynamic contentDistribution, archiving, compliance

How to Convert HTML to PDF from the Command Line

Step 1. Install Total HTML Converter X

Download the installer from the link above and run it on your Windows server or workstation. The setup takes under a minute. No browser or Microsoft Office installation is required — the converter uses its own rendering engine that handles HTML tags, CSS 1/2 styles, and embedded images.

Step 2. Open the Command Prompt

Open cmd.exe or PowerShell. The converter executable is HTMLConverter.exe, located in the installation folder (typically C:\Program Files\CoolUtils\TotalHTMLConverterX\). Add it to your system PATH or use the full path in your commands.

Step 3. Run the Basic Conversion

The simplest command converts all HTML files in a folder to PDF:

HTMLConverter.exe C:\Pages\*.html C:\Output\ -c PDF

This processes every .html file in C:\Pages\ and saves the resulting PDFs in C:\Output\. Each HTML file produces one PDF with the same base name.

Step 4. Add Security and Formatting Options

Control the PDF output with additional flags:

HTMLConverter.exe C:\Pages\*.html C:\Output\ -c PDF -OwnerPassword admin123 -NoPrint -NoCopy
  • -OwnerPassword admin123 — set a PDF owner password that controls permissions
  • -UserPassword open456 — set a password required to open the PDF
  • -NoPrint — disable printing in the output PDF
  • -NoCopy — prevent text selection and copying
  • -Watermark "CONFIDENTIAL" — stamp text across every page
  • -PageNum — add page numbers to the footer
  • -log C:\Logs\html2pdf.log — write a conversion log for verification

Step 5. Automate with a .bat File

Save your command in a .bat file and schedule it with Windows Task Scheduler:

@echo off
"C:\Program Files\CoolUtils\TotalHTMLConverterX\HTMLConverter.exe" C:\Incoming\*.html C:\Archive\PDF\ -c PDF -OwnerPassword secret -NoPrint -log C:\Logs\html2pdf.log

This runs the conversion every night (or at whatever interval you set) and writes a log file so you can verify the results.

ActiveX / COM Integration

Total HTML Converter X includes a full ActiveX interface. You can call the converter from any COM-compatible environment — .NET, VBScript, PHP, Python, Ruby, or ASP. This lets you embed HTML-to-PDF conversion into your own web application, intranet portal, or document workflow without shelling out to a command-line process.

Example (C#/.NET):

HTMLConverterX Cnv = new HTMLConverterX();
Cnv.Convert("C:\\Pages\\report.html", "C:\\Output\\report.pdf", "-c PDF -log c:\\Logs\\html.log");

Example (PHP):

$c = new COM("HTMLConverter.HTMLConverterX");
$c->convert("C:\\Pages\\report.html", "C:\\Output\\report.pdf", "-c PDF -log c:\\Logs\\html.log");

The same call works from ASP.NET, VBScript, Python, Ruby, Perl, and JavaScript (Windows Script Host). Your web application can accept uploaded HTML files and return PDFs to the user in real time.

Online Converters vs Total HTML Converter X

FeatureOnline ConvertersTotal HTML Converter X
Batch processingOne file at a timeUnlimited files per batch
File privacyFiles uploaded to third-party serverFiles never leave your machine
CSS renderingBasic, inconsistentFull CSS 1/2 support
PDF securityRarely availablePasswords, encryption, digital signatures
WatermarksNot available or brandedCustom text and image watermarks
AutomationManual onlyCommand line, .bat, Task Scheduler, ActiveX
Server deploymentNot possibleDesigned for servers, no GUI needed
Requires internetYesNo

When You Need HTML to PDF Command-Line Conversion

  • Report generation. A web application generates HTML reports. Total HTML Converter X converts them to PDF on the server side for download or email delivery — no browser rendering differences, no manual export.
  • Web page archiving. Organizations that need to preserve web pages as legal or compliance records convert saved HTML files to PDF. The fixed-layout PDF captures the page exactly as it appeared, independent of external resources.
  • Invoice and receipt generation. E-commerce platforms and billing systems create invoices as HTML templates. The converter turns them into print-ready PDFs with password protection and watermarks in a single command.
  • Document portal delivery. An intranet portal stores content as HTML. When users request a printable version, the server converts the HTML to PDF on the fly via ActiveX and streams the result to the browser.
  • Eliminating browser dependencies on servers. Running a full browser on a server for HTML-to-PDF conversion is resource-heavy and unreliable. Total HTML Converter X replaces the browser dependency entirely with a lightweight command-line tool.

Why Total HTML Converter X

No Browser Required

The converter uses its own rendering engine to parse HTML and CSS. You do not need Chrome, Firefox, or any browser installed on the server. This eliminates browser update issues, reduces the server footprint, and avoids the instability of headless browser automation.

True Server Application

Total HTML Converter X is designed for unattended use. No GUI windows, no dialog boxes, no confirmation prompts. It runs silently from the command line or as part of a service — exactly what a production server needs.

Full PDF Control

Set passwords, restrict permissions, add watermarks, insert page numbers, add digital signatures, customize headers and footers, control paper size and margins — all from the command line. Every option is available as a command-line flag or ActiveX parameter.

Not Just PDF

The same command-line tool converts HTML to DOC, XLS, TIFF, JPEG, RTF, TXT, and more. One installation covers all your HTML conversion needs. Change -c PDF to -c TIFF and you get TIFF output with the same batch and automation features.

Download Free Trial
(30 days, no email or credit card)

Windows 7/8/10/11 • Server 2008/2012/2016/2019/2022


quote

Total HTML Converter X Customer Reviews 2026

Rate It
Rated 4.7/5 based on customer reviews
5 Star

"We generate thousands of HTML reports daily from our analytics platform. Total HTML Converter X converts them to PDF on the server via ActiveX, and the results are clean and consistent. No headless browser needed, no Chrome updates breaking the pipeline. It has been running on our Windows Server for over a year without a single issue."

5 Star Martin Schlegel Lead Developer, DataServ GmbH

"Our compliance team needed to archive intranet pages as PDF for regulatory audits. We set up a nightly .bat script that converts the saved HTML pages to password-protected PDFs with watermarks. The whole batch of 500 pages runs in under ten minutes. Setup took less than an hour."

5 Star Patricia Duval IT Project Manager

"I integrated the ActiveX interface into our PHP billing system to generate invoice PDFs from HTML templates. The COM call is straightforward and the output matches the HTML layout accurately. CSS 2 rendering covers everything we need. The only thing missing is native Linux support, but on Windows Server it does exactly what we need."

4 Star Andrei Volkov Full-Stack Developer

FAQ ▼

The basic command is: HTMLConverter.exe C:\Pages\*.html C:\Output\ -c PDF. This converts every HTML file in the source folder to PDF. Add flags like -OwnerPassword, -NoPrint, or -Watermark to control the output.
No. Total HTML Converter X uses its own rendering engine to parse HTML and CSS. No Chrome, Firefox, or any other browser is required.
Yes. Use -OwnerPassword to set a password that controls permissions (printing, copying), and -UserPassword to set a password required to open the PDF.
Yes. Total HTML Converter X recognizes all standard HTML tags, CSS 1 and CSS 2 styles, inline images, and HTML tables. It renders pages faithfully without relying on an external browser engine.
Yes. Pass a URL as the source instead of a file path. The converter fetches the page and converts it to PDF. This works from both the command line and the ActiveX interface.
Yes. Total HTML Converter X registers as a COM/ActiveX object (HTMLConverter.HTMLConverterX). You can call it from .NET, PHP, Python, VBScript, ASP, Ruby, Perl, and any other COM-compatible environment.
Yes. Save the conversion command in a .bat file and add it to Windows Task Scheduler. The converter runs unattended at the scheduled time and writes a log file for verification.

 

Start working now!

Download free trial and convert your files in minutes.
No credit card or email required.

⬇ Download Free Trial Windows 7/8/10/11 • 228 MB

C++ sample
Power Basic sample
VBScript sample

Examples of Total HTML Converter X

Convert HTML files With .NET by TotalHTMLConverterX and .NET


string src="C:\\test\\Source.HTML";
string dest="C:\\test\\Dest.PDF";

HTMLConverterX Cnv = new HTMLConverterX();
Cnv.Convert(src, dest, "-c PDF -log c:\\test\\HTML.log");

MessageBox.Show("Convert complete!");

Download
.NET HTML Covnerter example
Server samples in C# specifically for ASP.net
Client application with WinForms in C#

Convert HTML & MHT Files On Web Servers With Total HTML Converter X

dim C
Set C=CreateObject("HTMLConverter.HTMLConverterX")
C.Convert "c:\source.HTML", "c:\dest.JPG", "-cJPG -log c:\html.log"
C.Convert "https://www.coolutils.com/", "c:\URL Page.PDF", "-cPDF -log c:\html.log"
set C = nothing
Example2 ASP: directly stream the resulting PDF
dim C
Set C=CreateObject("HTMLConverter.HTMLConverterX")
Response.Clear
Response.AddHeader "Content-Type", "binary/octet-stream"
Rresponse.AddHeader "Content-Disposition", "attachment; filename=test.pdf"
Response.BinaryWrite
  c.ConvertToStream("C:\www\ASP\Source.html", "C:\www\ASP", "-cpdf  -log c:\html.log")
set C = nothing

Convert HTML & MHT Files On Web Servers With Total HTML Converter X

Example PHP:
$src="C:\\test\\test.html";
$dest="C:\\test\\test.pdf";
if (file_exists($dest)) unlink($dest);
$c= new COM("HTMLConverter.HTMLConverterX");
$c->convert($src,$dest, "-c pdf -log c:\\HTML.log");
if (file_exists($dest)) echo "OK"; else echo "fail:".$c->ErrorMessage;

Convert HTML Files With Total HTML Converter X and Ruby

require 'win32ole'
c = WIN32OLE.new('HTMLConverter.HTMLConverterX')

src="C:\\test\\test.html";
dest="C:\\test\\test.tiff";

c.convert(src,dest, "-c TIFF -log c:\\test\\HTML.log");

if not File.exist?(dest)
  puts c.ErrorMessage
end

Convert HTML files With Total HTML ConverterX and Python

import win32com.client
import os.path

c = win32com.client.Dispatch("HTMLConverter.HTMLConverterX")

src="C:\\test\\test.eml";
dest="C:\\test\\test.tiff";

c.convert(src, dest, "-c TIFF -log c:\\test\\HTML.log");

if not os.path.exists(file_path):
  print(c.ErrorMessage)

Convert HTML files With Pascal and Total HTML Converter X

uses Dialogs, Vcl.OleAuto;

var
  c: OleVariant;
begin
  c:=CreateOleObject('HTMLConverter.HTMLConverterX');
  C.Convert('c:\test\source.html', 'c:\test\dest.tiff', '-c TIFF -log c:\test\HTML.log');
  IF c.ErrorMessage<>'' Then
    ShowMessage(c.ErrorMessage);
end;

Convert HTML Files On Web Servers With Total HTML Converter X

var c = new ActiveXObject("HTMLConverter.HTMLConverterX");
c.Convert("C:\\test\\source.html", "C:\\test\\dest.pdf", "-c PDF");
if (c.ErrorMessage!="")
  alert(c.ErrorMessage)

Convert HTML files With Total HTML Converter X and Perl

use Win32::OLE;

my $src="C:\\test\\test.html";
my $dest="C:\\test\\test.tiff";

my $c = CreateObject Win32::OLE 'HTMLConverter.HTMLConverterX';
$c->convert($src,$dest, "-c TIFF  -log c:\\test\\HTML.log");
print $c->ErrorMessage if -e $dest;
If you need examples on other languages please contact us. We will create any example specially for you.

Support
Total HTML Converter X Preview1

Related Topics

Latest News

Newsletter Subscribe

No worries, we don't spam.


© 2026. All rights reserved. CoolUtils File Converters

Cards