A fork of PDFme with enhanced schema capabilities
A fork of the PDFme library with extended schema capabilities, developed by a team at the US Department of Energy primarily for internal reporting needs but published open-source for the community's benefit.
This repository extends the excellent PDFme library with additional schema capabilities focusing on enhanced text formatting and display options. Our primary focus is on addressing limitations in the current implementation for reporting use cases. While this github repository contains a full fork of the pdfme repository for ease of development, modifications will be limited to the schemas.
-
Enhanced Text Schema:
- Conditional formatting based on field values
- Improved numerical formatting (currency, percentages)
- Border options for text elements
-
Dedicated Label Schema:
- Readonly by default (vs text schema where readonly is a toggle)
-
Table Display Schema:
- Non-dynamic tables for display purposes
- True table structures with aligned cells and borders
- Simplified layout for static content
-
Conditional Elements:
- Schema elements with conditional visibility
- Support for showing/hiding based on data values
The extended schemas follow the same plugin architecture as the original PDFme library. You can use them as plugins in the same way you would use the built-in schemas.
For complete documentation on the core PDFme functionality, please refer to the Getting Started guide.
For documentation specific to the extensions in this fork, please refer to the documentation in the packages/schemas directory.
Examples of using the extended schemas can be found in the playground directory, which contains a React application for testing and demonstrating the functionality.
If you're looking to contribute to this project, please follow these steps:
- Clone the repository
- Install dependencies with
npm install - Build the packages with
npm run build
[in pdfme-extensions dir] $ npm install
[in pdfme-extensions dir] $ npm run buildTo verify the build is successful, run the tests:
[in pdfme-extensions dir] $ npm run testThen, run development mode for the relevant packages:
[in pdfme-extensions/packages/common dir] $ npm run dev
[in pdfme-extensions/packages/schemas dir] $ npm run dev
[in pdfme-extensions/packages/ui dir] $ npm run dev
[in pdfme-extensions/packages/generator dir] $ npm run devFor testing in the browser, use the playground:
[in pdfme-extensions/playground dir] $ npm install
[in pdfme-extensions/playground dir] $ npm run devThis fork was created by a team at the US Department of Energy to address specific reporting needs, but we're publishing it as open-source to benefit the broader community. While developed primarily for internal use, we welcome community contributions and feedback.
As a work of the United States government, this project is in the public domain within the United States of America. Additionally, we waive copyright and related rights in the work worldwide through the CC0 1.0 Universal public domain dedication.
You can copy, modify, distribute, and perform the work, even for commercial purposes, all without asking permission. See LICENSE.md for more details.
This project is a fork of PDFme, a TypeScript-based PDF generator and React-based UI created by hand-dot and contributors. We extend our gratitude to the original developers for creating such a powerful and flexible library.
- pdf-lib: Used for PDF generation.
- fontkit: Used for font rendering.
- PDF.js: Used for PDF viewing.
- React: Used in building the UI.
- form-render: Used in building the UI.
- antd: Used in building the UI.
- react-moveable, react-selecto, @scena/react-guides: Used in the Designer UI.
- dnd-kit: Used in the Designer UI.
- Lucide: Used in the Designer UI and Schema's icon.
We are grateful to the developers of both PDFme and these underlying libraries that make our work possible.