Template Contribution Guide ❤️
Add your template to pdfme's Example Templates!
The playground template gallery is one of the most important entry points for pdfme, created to help new users find templates that match their requirements and save time.
By adding your template, you can contribute to the pdfme community.
We use GitHub pull requests for template additions - usually this only requires template files and metadata.
Even if you're new to OSS contributions, you can easily contribute by following this guide.
Template Addition Steps
1. Create Your Template
Design your template in the playground Designer, then download template.json using the Template JSON button
2. Prepare Repository
-
[Create Fork]
Click theForkbutton at the top-right of pdfme repository to copy to your GitHub account -
[Clone Locally]
Run in terminal (replaceYOUR-GITHUB-USERNAMEwith your GitHub username):git clone git@github.com:YOUR-GITHUB-USERNAME/pdfme.gitcd pdfme -
[Create Branch]
Create new branch (example using template namemy-new-template):git checkout -b add-my-new-template
3. Add Template Files
-
[Create Directory]
Create new directory in kebab-case (e.g.my-new-template):mkdir -p playground/public/template-assets/my-new-template- Directory name will appear as
My New Templatein the playground template gallery
- Directory name will appear as
-
[Place Files]
Place downloadedtemplate.jsonin the new directory
(Optional) Addauthorfield for credit:{"author": "YOUR-GITHUB-USERNAME","basePdf": ...} -
[Add Metadata] Add
metadata.jsonin the same directory. This metadata is used by the template gallery filters and cards.{"description": "A short description of what this template is useful for.","tags": ["Invoice", "Business"]}Optional fields:
title: display title. If omitted, the directory name is converted from kebab-case.order: gallery sort order for featured templates. Most contributions can omit this.tags: short filter labels such asInvoice,Business,CJK,Form, orTable.
Reference: https://github.com/pdfme/pdfme/tree/main/playground/public/template-assets/invoice
-
[Regenerate Gallery Metadata] Run:
npm --prefix playground run generate-template-assetsThis updates the generated template manifest used by the playground and CLI.
4. Commit Changes
-
[Record Changes]
Run in terminal:git add .git commit -m "feat: Add My New Template" -
[Push to GitHub]
Push to your repository:git push origin add-my-new-template
5. Create Pull Request
-
Create PR on GitHub
Go to your repository page →Pull requests→New pull request -
Select Branches
base repository: pdfme/pdfme (main branch)head repository: YOUR-GITHUB-USERNAME/pdfme (add-my-new-template branch)
-
Enter Information
- Title:
Add [My New Template] template - Include brief description of template features and use cases
- Title:
-
Submit PR
ClickCreate pull requestto complete!
6. Await Merge
After maintainer review, your template will be merged and listed officially 🎉
(If modifications needed, you'll receive comments on GitHub)
Thank you! Your contribution makes a big impact on pdfme's community 🚀
Need Help?
If you have questions, ask with screenshots in Discord #template-contribution for smooth support!