Class CharacterPDF
java.lang.Object
CharacterPDF
Facility for writing PDF character sheets.
- Since:
- 2020-04-09
-
Field Summary
Modifier and TypeFieldDescription(package private) static final String
Name of PDF character sheet source file.(package private) static final int
Maximum attack mode lines on the sheet.(package private) static final int
Maximum special ability lines on the sheet.(package private) static final int
Estimated characters per special ability line.(package private) int
Number of special ability lines used. -
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescription(package private) void
addLineToSpecial
(org.apache.pdfbox.pdmodel.interactive.form.PDAcroForm form, String s) Add one pre-formatted lins to the special ability section.(package private) void
addSegmentToSpecial
(org.apache.pdfbox.pdmodel.interactive.form.PDAcroForm form, String label, String segment) Add a segment to the special ability lines, if nonempty.(package private) void
addStringToSpecial
(org.apache.pdfbox.pdmodel.interactive.form.PDAcroForm form, String s) Add a string to the special ability lines.(package private) String
formatLeadZeroes
(int value, int places) Format number with lead zeroes.(package private) String
getRacialAbilities
(String race) Get racial ability descriptions.static void
Main test method.void
Write a character to a PDF file.
-
Field Details
-
CHAR_SHEET_FILE
Name of PDF character sheet source file.- See Also:
-
SPECIAL_LINE_LENGTH
static final int SPECIAL_LINE_LENGTHEstimated characters per special ability line.- See Also:
-
NUM_SPECIAL_LINES
static final int NUM_SPECIAL_LINESMaximum special ability lines on the sheet.- See Also:
-
NUM_ATTACK_LINES
static final int NUM_ATTACK_LINESMaximum attack mode lines on the sheet.- See Also:
-
specialLinesUsed
int specialLinesUsedNumber of special ability lines used.
-
-
Constructor Details
-
CharacterPDF
public CharacterPDF()
-
-
Method Details
-
writePDF
Write a character to a PDF file. -
formatLeadZeroes
Format number with lead zeroes. -
getRacialAbilities
Get racial ability descriptions. -
addSegmentToSpecial
void addSegmentToSpecial(org.apache.pdfbox.pdmodel.interactive.form.PDAcroForm form, String label, String segment) throws IOException Add a segment to the special ability lines, if nonempty.- Throws:
IOException
-
addStringToSpecial
void addStringToSpecial(org.apache.pdfbox.pdmodel.interactive.form.PDAcroForm form, String s) throws IOException Add a string to the special ability lines.- Throws:
IOException
-
addLineToSpecial
void addLineToSpecial(org.apache.pdfbox.pdmodel.interactive.form.PDAcroForm form, String s) throws IOException Add one pre-formatted lins to the special ability section.- Throws:
IOException
-
main
Main test method.
-