Hey Dev.to folks 👋
I wanted to share something I recently launched — Web2Docx — a simple API that converts HTML (or any URL) into PDF, DOCX, and image files.
Why I Built This
I was working on a client project last year where I had to generate custom invoices, certificates, and a lot of user-facing documents. Every tool I tried felt like a headache — either too complex, too slow, or not flexible enough with styling.
Some options required setting up headless browsers, others involved Word macros or weird templating engines. I just wanted something fast and reliable — pass some HTML and get a nice, styled PDF or DOCX back.
So I decided to build it myself.
What Web2Docx Does
🛠️ It supports:
HTML to PDF
HTML to DOCX
HTML to Image (PNG/JPEG)
⚡ Key highlights:
Fast and clean output
Supports modern CSS (no inline styles needed)
No need to install anything
Works great with React, Next.js, Node, etc.
You just send a POST request with your HTML or URL — and you get a downloadable file.
What's Unique
It's not based on puppeteer or headless Chrome (so it's faster and lighter).
DOCX generation is fully CSS-supported — no janky formatting.
Built with devs in mind: clean SDK and clear docs.
Try It Out
I just launched it on Product Hunt today. If you want to support or try it out, here’s the link:
👉 https://www.producthunt.com/posts/web2docx
Would love your feedback — especially from other devs who’ve been frustrated with document generation tools.
Documentations: Web2docx Documentation
How to Integrate It (Quick Example 🚀)
You can get started in just a couple lines using our official SDK:
npm i @web2docx/web2docx-sdk
const { Web2DocxClient } = require("@web2docx/web2docx-sdk");
const client = new Web2DocxClient("YOUR_API_KEY");
const fs = require("fs");
async function htmlToPdfExample() {
const html = "<h1>Hello World</h1>";
const pdfBuffer = await client.htmlToPdf(html);
fs.writeFileSync("output.pdf", pdfBuffer);
}
htmlToPdfExample();
Thanks for reading ❤️