Bring your HTML
Paste markup, choose an HTML file, or load our sample. Add linked CSS, images, and TTF/OTF/WOFF fonts using Supporting files. Hold Ctrl or Command to select several.
A place to read, rearrange, and get things ready.
Open a document to read its pages and copy text.
Drop your PDF here, or choose a file below.
Up to 20 MiB total · 200 PDF pagesEach image becomes an A4 page. Use the arrows to change their order.
Pages have 24-point margins. JPEG orientation follows its stored pixels; preview the result.
Text export: selectable words and page breaks are included. Images, tables, columns, and styling are not recreated. Scanned pages need OCR, which is not included.
You'll get a new PDF; your original is unchanged. Interactive forms, bookmarks, and digital signatures may not carry over.
Checks compare selectable text and token counts, including numbers. They do not certify accuracy, reading order, visual layout, or OCR quality. Page references point to the original; repeated content may make attribution approximate.
Bring your HTML. We'll make it a document.
Ready when you are. No installation needed for browser conversion.
Paste markup, choose an HTML file, or load our sample. Add linked CSS, images, and TTF/OTF/WOFF fonts using Supporting files. Hold Ctrl or Command to select several.
Choose size and margin, then Convert to PDF. Conversion runs in a Web Worker. You can cancel; loading has its own two-minute allowance, then conversion has up to 60 seconds of processing time.
Read any font or resource notes, download the PDF, and inspect it in your PDF viewer. Clear everything removes the inputs and generated download from this page.
Supporting files are matched by their exact, case-sensitive filename. For example, images/logo.png uses a selected logo.png. Each filename must be unique. Data URLs work without extra files. Absolute web URLs are not mapped to local files or fetched. This tool does not capture a live website or run scripts.
The browser downloads four Liberation Sans faces in parallel on first use and caches their versioned files. Repeat conversions in this tab reuse the loaded font bytes. Add fonts for other families or characters. This browser integration does not include a WOFF2 decoder; use TTF/OTF/WOFF here or the Node.js version for WOFF2. Documents are not deliberately saved in browser storage or uploaded by the converter. The surrounding page uses the site’s normal analytics and advertising.
Use HTMLPDF on Windows, macOS, or Linux with Node.js. The cleaned release includes compiled modules, TypeScript source, tests, fonts with their notices, a practical installation guide, and a sample HTML/PDF pair. It contains no npm dependencies, Python caches, or browser binaries.
ZIP · 6.37 MiB · 6,684,285 bytes · Software: MIT license · Fonts retain their original licenses.
dist/ compiled ESM · src/ source · fonts/ font pack · examples/ sample input/output · tests/ fixtures and tests · tools/ optional comparison utilities. The optional fonts-cjk/ pack is not included.
Check the downloaded ZIP in PowerShell:
Get-FileHash .\htmlpdf-0.2.0.zip -Algorithm SHA256macOS: shasum -a 256 htmlpdf-0.2.0.zip. Linux: sha256sum htmlpdf-0.2.0.zip.
5f266da58c81cbe6e5628a59f66eac234a9699f53e3911e32452dff7163640e2The sample PDF was generated locally with the packaged Node.js converter. Try the same markup with Load sample above.
Install Node.js for your OS and architecture from nodejs.org. The package requires Node 18 or later; choose a supported release. Reopen your terminal and check node --version.
Open PowerShell or a terminal in the extracted htmlpdf-0.2.0 folder. Keep dist/ and fonts/ together. Do not run inside the ZIP preview.
Run the commands below, then open output/sample.pdf. No npm install, TypeScript compiler, browser, Office, or LibreOffice is needed for the compiled CLI.
node --version
node dist/cli.js --help
node dist/cli.js examples/sample.html -o output/sample.pdfAll CLI examples here assume that working directory. Quote paths containing spaces. Optionally run npm link inside the package to register the htmlpdf command on your npm executable PATH; using node dist/cli.js avoids this global setup.
npm ci
npm run build
npm testThese developer commands install the locked TypeScript development dependencies and need network access on a fresh machine. Normal conversions have zero npm runtime dependencies. Python tools under tools/ are optional comparison utilities with separate requirements; they are not needed for conversion.
node dist/cli.js "documents/report.html" -o "output/report.pdf"
node dist/cli.js documents/ -o pdfs/
node dist/cli.js page.html --size "A4 landscape" --margin "15mm 20mm"
node dist/cli.js page.html --css print.css --fonts "my-fonts"Without -o, output is written beside each input with a .pdf suffix. Parent output directories are created. Folder mode converts immediate .html, .htm, and .xhtml files, case-insensitively, in sorted order and one at a time. It does not scan subfolders. For several input arguments, use an existing output directory or a trailing slash to avoid writing them all to one file.
| Option | What it does |
|---|---|
-o, --output PATH | Output filename or directory. For a single file, a new directory needs a trailing slash; existing directories are recognized. Folder input always treats PATH as a directory. |
--size SIZE | A4, letter, legal, A3, A5, “A4 landscape”, or custom dimensions such as “210mm 297mm”. Quote values with spaces. |
--margin VALUE | CSS length or shorthand, such as 20mm or “1in 0.75in”. Document @page rules override this and --size. |
--css FILE | Extra stylesheet, applied after the document’s own styles. |
--fonts DIR | Add a font directory. Repeat the option for more directories. |
--system-fonts | Also search fonts installed on the current machine. |
--http | Allow HTTP(S) resource requests for images, stylesheets, and fonts. Input is still a local file or folder, not a website URL. |
--no-outline | Omit PDF bookmarks generated from headings. |
--no-compress | Leave PDF streams uncompressed for debugging. |
-q, --quiet | Only print errors; also hides conversion notes and font substitutions. |
-h, --help | Print usage. Version 0.2.0 has no --version flag. |
Exit codes: 0 means success, including an empty folder; 1 means an input/conversion failure; 2 means invalid arguments. Setup errors such as an unreadable extra CSS file can terminate the process. A batch can produce some PDFs even if other files fail.
Install the extracted local package from your application directory, then use an ESM .mjs script. This does not assume HTMLPDF is published on npm. Keep the extracted folder available if npm links it locally. A script inside the extracted package can instead import ./dist/node.js directly.
// From your application folder, install the extracted local package:
// npm install "C:/Tools/htmlpdf-0.2.0" (Windows example)
// npm install "/absolute/path/htmlpdf-0.2.0" (macOS/Linux)
// Save as app.mjs and run: node app.mjs
import { convertFile, convertHtml } from 'htmlpdf/node';
import { writeFile } from 'node:fs/promises';
const result = await convertFile('report.html', 'output/report.pdf');
console.log(result.pages, result.warnings, result.fontSubstitutions);
const { pdf } = await convertHtml('<h1>Hello</h1>', {
pageSize: 'A4', margin: '15mm'
});
await writeFile('hello.pdf', pdf);The result includes pdf bytes, pages, warnings, fontSubstitutions, and missingGlyphs; convertFile also returns outputPath. Use try/catch around conversions. Node helpers load the bundled fonts automatically.
Serve the files over HTTP(S), using a bundler or native ES modules. The core API does not automatically load fonts. This minimal example produces a download link without permitting external resources:
import { convert, FontRegistry } from './dist/index.js';
const fonts = new FontRegistry();
const response = await fetch('./fonts/LiberationSans-Regular.ttf');
fonts.addFile(new Uint8Array(await response.arrayBuffer()), 'pack');
const { pdf } = await convert('<h1>Hello</h1>', {
fonts, pageSize: 'A4', margin: '15mm',
loadResource: async () => null // No external resources in this example
});
const url = URL.createObjectURL(new Blob([pdf], {type: 'application/pdf'}));
const link = document.createElement('a');
link.href = url; link.download = 'hello.pdf'; link.textContent = 'Download PDF';
document.body.append(link);
// Revoke url when the link is no longer needed, after download finishes.To load images and CSS, provide baseUrl and a loadResource(url) callback returning bytes or null. Restrict access to resources you intend to allow. Network requests in a browser are subject to CORS. Use a worker for larger conversions; release object URLs after use. WOFF2 requires a Brotli decoder via setBrotliDecoder() in browsers; Node configures its built-in decoder.
Useful options include pageSize, margin, userStylesheet, outline, links, fitWidth, compress, and metadata such as title and author. Document @page size/margins override option defaults.
The download includes Liberation Sans/Serif/Mono, Carlito, Caladea, DejaVu Sans/Serif, and NanumGothic. They provide common metric-compatible substitutions and Korean coverage. Microsoft fonts and the optional Chinese/Japanese CJK pack are not bundled. Supply appropriately licensed fonts for additional characters; font coverage alone does not add complex-script shaping.
Use --fonts DIR, --system-fonts, @font-face, or FontRegistry.addFile(). The HTMLPDF_FONT_DIRS environment variable takes semicolon-separated directories on Windows and colon-separated directories on macOS/Linux:
# PowerShell
$env:HTMLPDF_FONT_DIRS = 'C:\Fonts;D:\TeamFonts'
# macOS / Linux shell
export HTMLPDF_FONT_DIRS='/opt/fonts:/home/me/fonts'Node resolves local assets relative to the input HTML file and supports data URLs. Remote resources require --http or http: true; enabling this sends requests to the referenced servers. The Node loader can read files accessible to its process, so use trusted documents or a restricted loader/environment for untrusted inputs. The browser tool above permits only embedded data and explicitly selected local files.
HTMLPDF builds its own document tree, resolves the CSS cascade, measures text with font metrics, lays out boxes, and splits the content into pages. Its PDF 1.7 writer embeds font subsets and writes text, images, vector graphics, link annotations, metadata, and heading bookmarks. It does not launch Chromium or execute document JavaScript.
| Area | Supported features |
|---|---|
| Layout & print | Blocks, inlines, floats, flexbox, grid, tables, positioning, print styles, @page, page breaks, and repeated table headings. |
| Text & decoration | Fonts, kerning, lists, counters, generated content, borders, backgrounds, gradients, shadows, and 2D transforms. |
| Images & navigation | PNG, JPEG, BMP, GIF (first frame), SVG, PDF links, heading outlines, and document metadata. |
JavaScript, multi-column layout, right-to-left text and complex-script shaping, hyphenation, ::first-letter/::first-line, filters/blend modes, and WebP are unsupported. A single tall table row or image cannot split across pages. Form controls become static content. This is an independent renderer, so output can differ from browser printing. The upstream README’s historical Chromium comparisons are not a guarantee for your documents.
In the browser, select the supporting files and ensure their filenames match references exactly. Web URLs are blocked and WOFF2 needs the Node version or a custom browser decoder. In the CLI, preserve relative paths and use --http only if you want remote requests. Read conversion notes; add missing fonts rather than renaming file extensions.
CSS @page rules override the chosen size and margins. Change or remove those rules in the source. Print media styles may also differ from what you see on screen.
Scripts do not run. Save static rendered HTML with its styles and assets first. Layout differences can also come from unsupported CSS, missing fonts, or complex-script shaping. Check the resulting PDF before sharing it.
Install Node.js, reopen your terminal, and check node --version. Extract the entire ZIP, change into htmlpdf-0.2.0, and run the command there. Keep dist and fonts together. You do not need npm install just to run the supplied CLI.
The browser shows a Download PDF button when conversion finishes. Your browser controls where that download is saved. The CLI defaults to the input folder; -o changes the destination. Ensure it is writable and close any application locking the destination PDF.
The online tool accepts 20 MiB total, at most 100 supporting files, and allows up to 60 seconds of processing after the converter and bundled fonts load. Loading has a separate two-minute timeout. Images and layout can require much more memory than input size suggests. Reduce image sizes, split the document, or use the downloadable CLI for larger work.
The software is supplied under the MIT license, included in the download. Preserve its copyright and permission notice when redistributing. Bundled fonts retain their own license terms; the package includes those notices separately.
Download the converter to work with DOCX files on your computer.
Extract the ZIP and run the included command-line tool with the .NET 8 runtime on Windows, macOS, or Linux. Developers can use the library directly.
This is a terminal tool and developer library. Conversion runs after download; there is no browser upload or graphical app.
cli/ runnable .NET 8 CLI · lib/ .NET 8 and .NET Standard 2.0 libraries · nuget/ local NuGet package · source/ .NET source and tests · examples/ two DOCX inputs and reference PDF outputs. Fonts and the .NET runtime are not bundled.
In PowerShell, run from the folder containing the downloaded ZIP:
Get-FileHash .\Docxpdf-0.3.0.zip -Algorithm SHA256EA8DFFE75C6A1F253DC06469EAD61F2905EC21A26F9F34CB1FE0C1F2194FFF5FInstall Microsoft’s .NET 8 runtime for your OS and architecture. Run dotnet --list-runtimes and look for Microsoft.NETCore.App 8.0.x. The .NET 8 SDK also includes the runtime.
Extract all ZIP contents. Open PowerShell or your terminal inside the extracted Docxpdf-0.3.0 folder. Keep the files inside cli/ together.
Use the commands below. Open output/headings.pdf and check the result. The terminal reports page counts, warnings, and substituted fonts.
dotnet cli/Docxpdf.Cli.dll --version
dotnet cli/Docxpdf.Cli.dll examples/headings.docx -o output/headings.pdfAll commands on this page assume that working directory. A runtime is enough to run the CLI; an SDK is needed only to build C# applications or the included source. A newer major runtime alone may not run this .NET 8 application.
These generated test documents are included in the ZIP. The linked PDFs were produced by the packaged CLI on this Windows machine. Your output may differ when different fonts are installed.
A two-page reference PDF demonstrating heading styles and paragraph alignment.
A two-page reference PDF demonstrating table layout and cell formatting.
dotnet cli/Docxpdf.Cli.dll examples -o output -j 2To inspect DOCX files in a browser, use the separate Toolmints DOCX viewer.
dotnet cli/Docxpdf.Cli.dll "documents/report.docx"
dotnet cli/Docxpdf.Cli.dll "documents/report.docx" -o "output/final-report.pdf"The first command creates documents/report.pdf. The second writes to your chosen filename, creating its parent directory if necessary.
dotnet cli/Docxpdf.Cli.dll "documents" -o "pdfs" -j 4This converts the DOCX files immediately inside documents to PDFs inside pdfs, with up to four conversions at once. Add subfolders separately. Start with the default one job for large or image-heavy documents.
| Argument | What it does |
|---|---|
inputs | One or more DOCX files or folders. Quote paths containing spaces. Folder scans do not include subfolders and skip Word temporary files beginning with ~$. Use lowercase .docx extensions for portability. |
-o, --output PATH | Output filename for one file, or a folder for multiple inputs / folder mode. For one file, an existing directory is recognized as a folder; otherwise PATH is treated as the exact output filename. Omit to write beside each input. |
-j, --jobs N | Convert up to N files in parallel. Positive integer; default 1. Start small and increase only when memory and CPU allow. |
--fonts DIRS | Extra font folders searched first. Separate folders with a semicolon on Windows or a colon on macOS/Linux; quote the whole argument. |
-q, --quiet | Print only errors. This also hides conversion warnings and font-substitution notices. Leave it off while checking output quality. |
--version / -h, --help | Print the version or usage information and exit. |
Exit codes: 0 means success, 1 means one or more conversions failed, and 2 means invalid usage or no DOCX files found. A batch can produce successful PDFs even when another file fails. Directory/access errors outside conversion can terminate before the normal summary.
The local NuGet package selects the appropriate library target: net8.0 or netstandard2.0. Register the extracted nuget folder using its absolute path, then add version 0.3.0 to your project. Keep your usual NuGet feed enabled so dependencies can be restored.
dotnet nuget add source "ABSOLUTE/PATH/Docxpdf-0.3.0/nuget" --name DocxpdfLocal
# Then, from your application project:
dotnet add package Docxpdf --version 0.3.0using System;
using Docxpdf;
// Optional: configure fonts once, before starting conversions.
// DocxConverter.SetFontDirectories(new[] { "path/to/fonts" });
try
{
var result = DocxConverter.Convert("report.docx", "output/report.pdf");
Console.WriteLine($"{result.Pages} pages -> {result.OutputPath}");
foreach (var warning in result.Warnings)
Console.WriteLine("Note: " + warning);
foreach (var font in result.FontSubstitutions)
Console.WriteLine($"{font.Key} -> {font.Value}");
}
catch (ConversionException error)
{
Console.Error.WriteLine(error.Message);
}using System.IO;
using Docxpdf;
using var input = File.OpenRead("report.docx");
using var output = File.Create("report.pdf");
var result = DocxConverter.Convert(input, output);
// Or convert a byte array:
byte[] pdf = DocxConverter.Convert(
File.ReadAllBytes("report.docx"), out var byteResult);The caller owns the streams. Stream input is copied into memory; these APIs do not provide constant-memory streaming. Handle file and stream I/O errors in your application as well as ConversionException.
Reference lib/net8.0/Docxpdf.dll in a compatible application, or use lib/netstandard2.0/Docxpdf.dll for a host supporting .NET Standard 2.0. The .NET Standard build requires System.Text.Encoding.CodePages 8.0.0 and its dependencies, which are not bundled in lib/; the NuGet package resolves them during restore. XML IntelliSense documentation and PDB symbols are included.
Conversions can run in parallel. Configure DocxConverter.SetFontDirectories(...) once before starting work because it replaces the process-wide font library. Font-substitution diagnostics can include earlier conversions in that process. Use separate output paths and bound concurrency, input sizes, and processing time for your workload.
dotnet build source/Docxpdf.sln -c Release
dotnet test source/Docxpdf.sln -c ReleaseThese commands require a compatible .NET SDK and package restore. The source is included for inspection and integration; no additional redistribution license is granted by this download package.
The engine measures text using the fonts installed on the conversion machine. If a requested font is missing, a substitute can change line breaks, table heights, and page counts. Windows does not necessarily include every font used by Word documents.
Windows example (use : between directories on macOS/Linux):
dotnet cli/Docxpdf.Cli.dll "report.docx" --fonts "C:\MyFonts;C:\TeamFonts"You can also set DOCXPDF_FONT_DIRS, put TTF/TTC fonts in a fonts folder next to Docxpdf.dll, or configure font directories through the C# API.
sudo apt install fonts-crosextra-carlito fonts-crosextra-caladea fonts-liberation fonts-dejavu fonts-noto-cjkNo fonts are bundled in this package. Check each font’s license before redistributing it. Review warnings and the final PDF, especially for complex documents; matching fonts does not guarantee an identical Microsoft Word layout.
The managed C# engine reads the Office Open XML package, builds a document model, resolves styles and fonts, and flows content onto pages. Its PDF writer emits text, images, and vector graphics, with TrueType embedding and subsetting. It does not automate Microsoft Office or launch LibreOffice.
| Feature group | Supported by the engine |
|---|---|
| Text & page structure | Styles, formatting, lists, sections, columns, headers/footers, notes, page fields, links, bookmarks, and PDF outlines. |
| Tables & pictures | Merged cells, borders, header rows and row splitting; PNG, JPEG, GIF, BMP, TIFF, EMF and WMF images, including cropping. |
| Drawings & languages | Shapes, text boxes, charts, cached SmartArt drawings, OMML equations, right-to-left text, Arabic shaping, Hebrew, CJK and Korean. |
.doc, encrypted documents, and non-DOCX files need conversion to an unprotected DOCX in a suitable editor first.This is an independent renderer. The upstream README reports comparisons against the Python engine; those historical results are not a guarantee of Microsoft Word fidelity or a benchmark for your machine. Check representative documents before relying on automated output.
Install the .NET 8 runtime for your OS and architecture, reopen the terminal, and check dotnet --list-runtimes. Keep the published CLI files together, including its runtime configuration. The .NET Framework runtime alone cannot run this CLI.
Run commands from the extracted Docxpdf-0.3.0 folder. Use an absolute input path if the document is elsewhere and quote paths containing spaces. Do not run from inside the ZIP preview.
Install the needed fonts or specify a custom font directory. Rerun without --quiet so you can inspect substitutions and warnings. Check the output visually; unsupported layout features can also affect the result.
Open it in its original editor and save an unprotected DOCX. Changing a .doc or .odt extension to .docx does not convert the file. The parser attempts some ZIP/XML recovery, but cannot recover every damaged document.
Without -o, PDFs are created beside the input files. With one input, a new output path is interpreted as a filename: include .pdf. Folder mode uses the output as a destination directory. Check write permissions and close applications that may lock the output file.
The engine buffers each document and PDF in memory. Reduce -j, split large batches, and avoid running many image-heavy conversions at once. There is no documented universal maximum file size.
The supplied converter processes documents locally and has no upload integration. Installing the runtime or restoring NuGet packages can need network access. This website uses its normal analytics; the document contents are not sent by the conversion code.
Download the package, run the included example, and check your fonts before converting a larger batch.
Download Docxpdf 0.3.0 ↓Document contents stay in your browser and are not uploaded. Clear the workspace or close the tab to release them. The website uses its normal analytics and advertising.
PDF to Word keeps page positions, font styling, and graphics as closely as possible. Text is editable in positioned blocks; graphics remain images and tables are not rebuilt as native Word tables. Fonts may be substituted by Word. Scans and unsupported text effects stay as page images and are flagged for review. PDF to HTML is a plain text export. Conversion Check highlights omissions but cannot guarantee visual fidelity.
Yes, you can read and arrange them, save pages as images, or keep them as page images in a Word document. Making scanned text editable requires OCR, which is not included. Password-protected files need an unprotected copy.
Switch tasks at any time; files and page selections stay on your desk. After creating a PDF, Open result replaces the workspace with that PDF so you can keep working. Download what you want to keep before leaving.