Skip to content
프로젝트

소개

LaTeX의 현대적인 대안입니다. React, JSX, Tailwind를 사용해 PDF 문서 템플릿을 만들 수 있습니다.

웹 및 앱 개발

이 수치를 측정하는 방법

측정된 스타 증가

in 24h
0
in 7 days
-1
in 15 days
-1
in 1 month
기록 수집 중

서로 겹치는 기간의 순증가량이며 일별 합계가 아닙니다. 측정값이 없으면 비워 둡니다. 스타는 관심도를 나타내며 품질을 보장하지 않습니다.

README.md

Original

htmldocs

PDF document creation is stuck in the past, from clunky Word docs to complex LaTeX to outdated tools. htmldocs brings document generation into 2025 with a modern developer experience using the tools you already love: React, TypeScript, and Tailwind.

What is htmldocs?

htmldocs is a local document editor and preview server to help you create PDFs with React. It provides all the structural benefits of LaTeX with the familiarity of HTML and CSS. With htmldocs, you can use JSX to build document templates (invoices, reports, contracts, etc.) and generate PDFs just by passing data as props. htmldocs has:

  • 📌 Support for the latest CSS features like margin boxes and flexbox
  • 🧩 A collection of unstyled components to help you layout your documents
  • 📄 JSX templating system for building dynamic documents
  • 🔗 Full TypeScript support for type safety
  • ⚡ Dynamic data integration through props and APIs
  • 📊 Real-time preview server with hot reloading

Example

To see the full power of htmldocs, here is how you might build a dynamic invoice document template with JSX template variables:

Invoice template with htmldocs

To change the customer details, all you need to do is render the Invoice component with different props:

<Invoice 
  customer={{
    name: "John Doe",
    address: "456 Main St",
    city: "Anytown",
    state: "CA",
    zip: "12345",
    phone: "123-456-7890",
  }}
  items={items}
/>

Screenshots

Resume example

Variables editor

Install

To create your first htmldocs project, run the following command:

npx htmldocs@latest init

For further instructions or to integrate htmldocs into your existing project, refer to the Getting Started guide.

Components

htmldocs comes with a standard set of components to help you layout and style your documents.

How it works

htmldocs is built upon Chromium's rendering engine, which means it can render any HTML, CSS, and JavaScript. This is different from other tools like wkhtmltopdf, WeasyPrint, and Prince, which only support a subset of HTML and CSS.

htmldocs also uses the Paged.js library under the hood. Paged.js is used for layout and chunking, as well as more modern features like margin boxes that aren't fully supported by the W3C's CSS standard.

Comparison

Feature Traditional Documents
(Word, Google Docs)
LaTeX Documents
(Overleaf, TeXStudio)
Freeform Documents
(Figma, Sketch)
Web Documents
(htmldocs)
Content Structure Semi-Structured Structured Freeform Structured
Learning Curve ✅ Simple ❌ Complex ✅ Simple ✅ Simple
Template Variables ❌ Limited ❌ Limited ❌ Limited ✅ Supported
Styling ✅ Basic ❌ Complex ✅ Advanced ✅ Advanced
Version Control ❌ Limited ✅ Supported ❌ Limited ✅ Supported
External Libraries ❌ Limited ✅ Supported ❌ Limited ✅ Supported
Automation / API ❌ Limited ❌ Limited ❌ Limited ✅ Supported
Live Preview ✅ Supported ❌ Limited ✅ Supported ✅ Supported
CI/CD Integration ❌ Limited ⚠️ Partial ❌ Limited ✅ Supported
Type Safety ❌ Limited ❌ Limited ❌ Limited ✅ Supported
AI ❌ Limited ❌ Limited ❌ Limited ✅ Supported

Tech Stack

Next.js TypeScript Turborepo pnpm
Next.js TypeScript Turborepo pnpm

License

MIT License

관련 프로젝트 살펴보기

불러오는 중…