英文原文正文为项目原始 README(英文),本站后续会翻译为中文,当前仅剔除图片与无关章节并统一排版。
High-quality, unstyled components for creating PDFs.
Demo Highlights 🎥
https://github.com/OnedocLabs/react-print-pdf/assets/33000377/0d8815a7-e858-4541-ba13-325d56f26c69
Key Features 🎯
- Easy to use: Build your first PDF with react-print-pdf in less than 5 minutes.
- Open source: Freedom is beautiful, and so is Fileforge. React-print-pdf is open source and free to use.
- Components & Templates: Kickstart your next document by using our list of components and template created by Fileforge's Team and the community.
- 100% Layout's control: Unlike other solutions, you have complete control over 100% of your layout, including margins, headers, footers, and more.
- Integrate dynamic data to your PDF: Streamline data from your database and integrate it seamlessly into your PDFs.
Introduction ℹ️
A collection of high-quality, unstyled components for creating beautiful PDFs using React and TypeScript. Forget about docx, latex, or painful outdated libraries. With react-print-pdf, embrace a new way to create PDFs, designed by and for developers.
Why❓
We believe documents are at the core of communication—invoices, contracts, resumes, brochures, etc. They are the primary method for exchanging information with others professionally. So, why do we continue to use decades-old technology to create them? We believe you deserve better. Document production needs to be modernized. Start today and create your next PDF the same way you build a web app. And yes, this includes automating data integration into your documents. Say hello to react-print-pdf.
How does it differ from other solutions? 🧐
Unlike other solutions, react-print-pdf gives you complete control over your documents, allowing you to design complex layouts with features like footnotes, headers, margins, and more. Additionally, it enables you to track and analyze specific parts of your document, and build and update charts using data from your database. And this is just the beginning—our team and the community will continue to develop great features to simplify the PDF generation process.
Getting started 🚀
1. 安装 💿
Get the react-print component library.
With npm
npm install @fileforge/react-print
With yarn
yarn add @fileforge/react-print
With pnpm
pnpm add @fileforge/react-print
2. 导入组件 ↪️
Import the components you need to your PDF template from our list of pre-build components :
import { PageTop, PageBottom, PageBreak } from "@fileforge/react-print";
3. 集成到你的文档中 📄
Integrate your components and include styles where needed.
export const Document = ({ props }) => {
return (
<div>
<PageTop>
<span>Hello #1</span>
</PageTop>
<div>Hello #2</div>
<PageBottom>
<div className="text-gray-400 text-sm">Hello #3</div>
</PageBottom>
<PageBreak />
<span>Hello #4, but on a new page ! </span>
</div>
);
};
4. 生成 HTML 💻
import { compile } from "@fileforge/react-print";
const html = await compile(<Document />);
Components 🗂️
A set of standard components to help you build amazing documents without having to deal with the mess of creating complex layouts and maintaining archaic markup. Help us extend this list by actively contributing and adding your favorite components!
Browse all currently supported components →
Help us extend this list by actively contributing and adding your favorite components!
Integrations 🔗
PDF designed with react-print-print can be generated, hosted (and more) with your preferred document management providers.
- Fileforge : HTML to PDF, cloud hosting, analytics and more.
Contributing 🫂
This project is open-source and is intended to be maintained and built by and for developers.
Wanna help ? Awesome! There are many ways you can contribute! Take a look at:
Authors 🧑💻
- Auguste L. (@thisisnotFranck)
- Pierre D. (@pierre_dge120)
- Titouan L. (@titouan325)
License 📜
Join the movement ! 🚀
活动
收藏历史 🌟
- 本文标题:react-print-pdf - 使用 React 构建和生成 PDF 📄
- 本文链接:https://www.cn121.com/uikit/onedoclabs-react-print-pdf.html
- 原项目:OnedocLabs/react-print-pdf 版权归原作者 OnedocLabs 及贡献者所有
- 收录信息:本站于 2026-11-22 收录本项目,本页所列协议与仓库指标均为收录当时的状态;该日期之后原项目的版本更新与协议变更,本页不作同步。
- 开源协议:收录时本项目采用 Apache-2.0(查看 LICENSE 原文),本站转载其原始文档(未改动文字,仅剔除图片与无关章节);使用、修改、分发请以该仓库 LICENSE 原文为准。本站对原文仅作排版与图片地址适配, 并保留原项目的 NOTICE 与署名要求。
- 站点出处:本文首发于 OneTwoOne,收录自 GitHub 开源项目 OnedocLabs/react-print-pdf。
- 内容说明:本页正文为原项目 README 原文(英文),本站后续会翻译为中文(当前尚未译出,仅将二级标题译为中文,便于按栏目定位;标题原文可在下方原仓库中查看),仅剔除了图片与赞助等无关章节、并把相对链接改为绝对地址;页首简介为机器翻译自仓库描述。
- 引用声明:商业转载、第三方聚合或 AI 检索训练引用时,请务必保留以上来源出处、本文永久链接,以及原项目的版权声明与许可信息。
- 下架通道:若原项目此后变更或收紧了许可协议、或作者/权利人认为本站的收录方式(译文、排版适配、简介翻译等)超出其授权范围,请通过 xyd3302001@163.com 发送下架通知,并附上项目地址与本页链接。本站核实后将第一时间删除本页内容,或改为不复制原文的目录性收录;署名更正等其他要求可一并提出。