Documents for developers

Onedoc makes it easy to generate PDFs using modern web technologies.

PDF Report
1
<Invoice
2
company="Acme Inc."
3
amount="$12.99"
4
date="2024-02-08"
5
paymentMethod="mastercard"
6
cardDigits={0911} />

Launch YC: Onedoc — Making it easy for developers to generate beautiful PDFs

Get started today

Create your first document in minutes. Our simple developer APIs allow a seamless integration with your existing stack.

1
import { Onedoc } from '@onedoc/client';
2
import fs from 'fs';
3
import { renderToString } from 'react-dom/server';
4
5
import { PDFTemplate } from './components/PDFTemplate';
6
7
const onedoc = new Onedoc(process.env.ONEDOC_API_KEY);
8
9
const { file, link, info, error } = await onedoc.render({
10
html: renderToString(<PDFTemplate title="My First PDF" />),
11
});
12
13
fs.writeFileSync('invoice.pdf', file);

Designed by developers, for real-world documents.

Documents as a Frontend

Craft custom documents with your favorite frontend tools like React and Vue.

On-the-fly Generation

Instantly generate dynamic documents based on real-time data.

Document Authentication

Secure your documents with trusted digital signatures.

Document Delivery Network

We handle document delivery and lifecycle management for you.

Analytics

Track views and downloads for insights into document engagement.

Ecosystem

Easily integrate with tools like Google Drive and DocuSign.


Beautiful documents, with frontend technology

Design templates with your favorite frontend technologies.
React, Vue, Tailwind, you name it.

1
2
import React from "react";
3
import { InvoiceTemplate } from "./components/invoice";
4
import { Onedoc } from "@onedoc/client";
5
import { readFileSync, writeFileSync } from "fs";
6
import { renderToString } from "react-dom/server";
7
import postcss from "postcss";
8
import tailwindcss from "tailwindcss";
9
import postcssColorFunctionalNotation from "postcss-color-functional-notation";
10
11
const ONEDOC_API_KEY = "####-####-####-####” // replace with your api key
12
13
const onedoc = new Onedoc(ONEDOC_API_KEY);
14
15
const data = {}; // load data for template
16
17
(async () => {
18
19
const html = renderToString(<InvoiceTemplate props={data} />)
20
const css = await postcss([
21
tailwindcss({
22
content: [{ raw: html, extension: "html" }],
23
}),
24
postcssColorFunctionalNotation,])
25
.process(`@tailwind base;@tailwind components;@tailwind utilities;`, {
26
from: undefined,
27
}); // loads compiled tailwind styles
28
29
let doc = {
30
html: html,
31
title: "Hello",
32
test: true, // if true, produce a PDF in test mode with a Onedoc's watermark
33
save: true, // if true, host the document and provide a download link in the console and your Onedoc's dashboard
34
expiresIn: 30, // the number of day you want to host your document
35
assets: [
36
{
37
path: "./style.css",
38
content: css.toString(),
39
},
40
],
41
};
42
43
const { file, link, error, info } = await onedoc.render(doc);
44
45
if (error) {
46
throw error;
47
}
48
49
console.log(link);
50
})();
51
Slide 0

Templates

We build templates so you don't have to.

Browse all templates
Receipt
Invoice
Report
Receipt
Invoice
Report

Testimonials

We have worked with some of the best teams and companies in the world.
Here is what they have to say.

“My experience with Onedoc has been amazing. I have been using Google Doc and LaTeX on Overleaf in the past, but always had trouble designing my documents as I wanted to. Onedoc has been a game changer for me, especially to manage layout, integrate images and code with ease. I am looking forward to the new features that will be developed by this great team!”

Basil
@basilyusuf1709

“Great team, great project. I am a beta tester since day-1 and already started building my docs using Onedoc. Looking forward to see what's coming next !”

Christophe Saad
@christophesaad

“Handling documents is something that had been needing an upgrade for a long time. OneDoc has done it, and i couldn’t be more excited for the new features that will be developed by this great team!”

Marc Watine
@marc-watine

Beautiful documents, easily

Join our public beta and start generating, hosting and tracking documents this afternoon.

Use Onedoc now, it's free