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
Comments
Join the discussionThanks for the thoughtful comment. Great questions! Fonts are bundled — Noto Sans Devanagari (plus 10 other Indic scripts) ships with the API, so Hindi conjuncts and mixed Hindi/English lines shape correctly out of the box, and you can embed your own via @font-face. The PDF link is presigned and expires in 1 hour for safety. And yes — PDFs stay in storage until you delete them; a delete endpoint is on the roadmap for the beta, so you'll have full control over your users' data.
Love that this started as a fix for your own project. That's usually the best kind of tool. I run a resume builder, so PDF export is the feature I worry about most. Multilingual is where I'd stress-test you first: Hindi conjuncts, or Hindi and English mixed on one line, break a lot of HTML-to-PDF setups unless the font is embedded. Do you bundle something like Noto, or does the caller pass the font? Also curious if the PDF link expires. For files with personal data, a short-lived URL would be a big trust point. Following for the beta.
Hey Mohan — quick update since you mentioned wanting to stress-test Hindi conjuncts and expiring links for your resume builder! The production beta and TypeScript SDK (@akcraft/html2pdf-sdk) just went live at https://html2pdf.akcraft.app
It ships with Google Noto fonts across 21 Indian languages (12 scripts) and waits for document.fonts.ready so mixed Hindi/English resume lines never render as tofu boxes—plus every PDF returns a 1-hour presigned URL with an on-demand DELETE endpoint and 2-hour auto-cleanup. Would love to see how your toughest bilingual resume template holds up on it!

