Class CharacterPDF

java.lang.Object
CharacterPDF

public class CharacterPDF extends Object
Facility for writing PDF character sheets.
Since:
2020-04-09
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    (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

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    (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
    Get racial ability descriptions.
    static void
    main(String[] args)
    Main test method.
    void
    Write a character to a PDF file.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details

    • CHAR_SHEET_FILE

      static final String CHAR_SHEET_FILE
      Name of PDF character sheet source file.
      See Also:
    • SPECIAL_LINE_LENGTH

      static final int SPECIAL_LINE_LENGTH
      Estimated characters per special ability line.
      See Also:
    • NUM_SPECIAL_LINES

      static final int NUM_SPECIAL_LINES
      Maximum special ability lines on the sheet.
      See Also:
    • NUM_ATTACK_LINES

      static final int NUM_ATTACK_LINES
      Maximum attack mode lines on the sheet.
      See Also:
    • specialLinesUsed

      int specialLinesUsed
      Number of special ability lines used.
  • Constructor Details

    • CharacterPDF

      public CharacterPDF()
  • Method Details

    • writePDF

      public void writePDF(Character c)
      Write a character to a PDF file.
    • formatLeadZeroes

      String formatLeadZeroes(int value, int places)
      Format number with lead zeroes.
    • getRacialAbilities

      String getRacialAbilities(String race)
      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

      public static void main(String[] args)
      Main test method.