Split premades
split_pdf(dry_run=True, roles=['Defender', 'Caster', 'Support', 'Martial'], level_max=3, pdf_path=Path(glob('./automation/_input/*PremadeSheet*pdf')[0]), out_folder=Path('../docs/src/1_Mechanics/PremadeCharacters/'), return_paths=False)
¶
Splits PDF for premades into individual png files: Premade_{Role}_Level{#}.png
Parameters:
Name | Type | Description | Default |
---|---|---|---|
dry_run |
bool
|
If true (default), just logs filename as info. |
True
|
roles |
list
|
Roles in order as they appear in pdf. Defaults to ["Defender", "Caster", "Support", "Martial"]. |
['Defender', 'Caster', 'Support', 'Martial']
|
level_max |
int
|
Max levels being split in file. Defaults to 3. |
3
|
pdf_path |
Path
|
Input pdf path. Defaults to Path(glob("../_input/temp_CharSheet*pdf")[0]). |
Path(glob('./automation/_input/*PremadeSheet*pdf')[0])
|
out_folder |
Path
|
Output png folder. Defaults to Path("../docs/src/1_Mechanics/PremadeCharacters/"). |
Path('../docs/src/1_Mechanics/PremadeCharacters/')
|
return_paths |
bool
|
If True, function returns list of output Pathlib objects. Defaults False. |
False
|
Source code in automation/pdf/split_premades.py
9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 |
|