Latest version | 0.24.9 |
---|---|
Minimum Core | 0.7.9 |
Compatible Core | 11 |
Last updated | 1 year ago |
Created | 3 years ago |
Authors |
|
Languages |
English Français Português (BR) |
Systems | All systems |
Project source | Project URL |
Report bugs | Bug tracker URL |
Read-me | Readme URL |
Changelog | Changelog URL |
License | License URL |
A system agnostic tool to export your Foundry character sheet to a PDF!
Just click on the button in the header of a character sheet and then it will open the configuration window. Once you upload a PDF, you'll see a list of each of the PDF's fields alongside an input. If you have a mapping configured correctly, those fields will automatically be filled out with the values from your character sheet.
This module requires you to upload a form-fillable PDF which it will fill out for you. If you need a copy of the PDF, there is a button which will download the correct one for some systems.
You can theoretically use this module with the PDF for any system, but some fields used on other PDFs may not be supported. File a bug if you encounter a PDF that doesn't work.
A mapping is required for the module to function as expected. You can edit the current mapping in module settings and there is also a dropdown menu with some community contributed mappings which you can load in.
A mapping is a JavaScript object (not JSON) which is saved with a .mapping
file extension. The mapping provides the information needed to know which PDF fields to associate with which values from your actor. It is also responsible for formatting, calculating, concatenating, etc. those values for display on the PDF character sheet.
TIP: Install Ace Library if you want to use a proper editor to work on creating your mapping.
The mapping is formatted like this:
[
{
"pdf": "CharacterName",
"foundry": @name
},
{
"pdf": "Check Box 11",
"foundry": @data.abilities.str.proficient
},
{
"pdf": "Race",
"foundry": @data.details.race
},
{
pdf: "Speed",
foundry: Object.entries(actor.data.data.attributes.movement).filter(val => val[1]).map(val => val[0] === "hover" ? Object.entries(actor.data.data.attributes.movement)[6][0] : "" + val[0] !== "units" && val[0] !== "hover" ? val.join(": ") + Object.entries(actor.data.data.attributes.movement)[5][1] : "").filter(String).join(", ")
},
{
pdf: "Backstory",
foundry: @data.details.biography.value?.replaceAll(/<[^>]*>/g, "").trim()
},
{ "pdf": "PlayerName", foundry: Object.entries(@permission).filter(entry => entry[1] === 3).map(entry => entry[0]).map(id => !game.users.get(id)?.isGM ? game.users.get(id)?.name : null).filter(x => x).join(", ") }
]
This will take care of filling out the character name, strength save proficiency, race, speed, and backstory on a D&D 5e character sheet.
As you can see, the @
is used to access properties of the Actor data, rather than a fixed value. You may use any valid JavaScript functions or formulas in the mapping, but it should return a String or coerce into one.
⚠️WARNING: Do not use line comments (you can use block comments) since the mapping is saved on one line.
While creating a mapping, it's very helpful to work in the browser console (F12):
Please share any mappings you create with me and I will include them in the module for the benefit of the community. See the mappings here.
To install this package, open your Foundry Setup screen and navigate to your Module tab and click the Install Module button.
From there, you can either search for the package unique name: pdf-sheet or copy its manifest URL:
And paste it to the input box at the bottom of your window.
You can install this package directly to your Forge account.
Necessary cookies are absolutely essential for the website to function properly. This category only includes cookies that ensures basic functionalities and security features of the website. These cookies do not store any personal information.
Functional cookies help to perform certain functionalities like sharing the content of the website on social media platforms, collect feedbacks, and other third-party features.
Analytical cookies are used to understand how visitors interact with the website. These cookies help provide information on metrics the number of visitors, bounce rate, traffic source, etc.
Performance cookies are used to understand and analyze the key performance indexes of the website which helps in delivering a better user experience for the visitors.
Advertisement cookies are used to deliver visitors with customized advertisements based on the pages they visited before and analyze the effectiveness of the ad campaign.