Skip to main content

Command Palette

Search for a command to run...

Why I'm building an HTML to PDF tool that works in every language

Updated
•2 min read•View as Markdown

I'm building a tool that turns HTML into a PDF. It isn't released yet. A beta is coming soon, and I want to share the story from the start.

How it started

In one of my personal project, AI Question Generator, I needed to create PDFs. So I built my own converter for it.

Then I thought: If I'll need this in my next project too. And the one after that. Copying the same code into every project means every bug gets fixed in many places, or not fixed at all.

So I moved it into one central library that all my projects can share. Once it worked well, I realized other developers might want it too. That's why I'm releasing it as an SDK.

What I wanted from it

Since I'd depend on it in my own projects, I held it to three goals:

  • Trustworthy: safe with my keys and my files

  • Fast: a PDF back in seconds

  • Multilingual: the text always shows up correctly

What it looks like

You send HTML, and you get a PDF link back:

import { Html2PdfClient } from "@sample-sdk/html2pdf-sdk";

const client = new Html2PdfClient({ apiKey: "YOUR_API_KEY" });

const result = await client.sendHtmlRequest({
  userId: "YOUR_USER_ID",
  content: "<h1>नमस्ते दुनिया</h1>",
});

console.log(result.pdfUrl); // link to your PDF