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 β€οΈ
Top comments (0)