Class CreatePDF

java.lang.Object
com.ehealthsystem.pdf.CreatePDF

public class CreatePDF extends Object
Class for creating a PDF document.
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    private static com.itextpdf.layout.element.Paragraph
    CenteredParagraph(com.itextpdf.layout.element.Text text, float width)
    Method to center the text.
    static void
    create_Pdf(String dest, boolean forAppointment)
    Method to create a PDF document with the health information and data of the user.
    private static void
    Disease(com.itextpdf.layout.element.Table table, boolean forAppointment)
    Method to add the health-problems of the user into the table.
    private static void
    InsuranceData(com.itextpdf.layout.element.Table table)
    Method to add insurance name and type into the table.
    private static void
    PersonalData1(com.itextpdf.layout.element.Table table)
    Method to add first and last name of the user into the table.
    private static void
    PersonalData2(com.itextpdf.layout.element.Table table)
    Method to add street and birthday of the user into the table.

    Methods inherited from class java.lang.Object

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

    • CreatePDF

      public CreatePDF()
  • Method Details

    • create_Pdf

      public static void create_Pdf(String dest, boolean forAppointment) throws IOException, SQLException
      Method to create a PDF document with the health information and data of the user.
      Parameters:
      dest - path where the created PDF doc should be saved.
      forAppointment - true if only the health information for the appointment in creation shall be included
      Throws:
      IOException - PDF document is not able to be saved.
      SQLException - if a connection issue with the database occurs
    • CenteredParagraph

      private static com.itextpdf.layout.element.Paragraph CenteredParagraph(com.itextpdf.layout.element.Text text, float width)
      Method to center the text. For this document it is only used for the headline.
      Parameters:
      text - The text which will be centered.
      width - The width of the Document to calculate the center.
      Returns:
      The Text in the center of the document.
    • PersonalData1

      private static void PersonalData1(com.itextpdf.layout.element.Table table)
      Method to add first and last name of the user into the table.
      Parameters:
      table - The provided Table for the data.
    • PersonalData2

      private static void PersonalData2(com.itextpdf.layout.element.Table table)
      Method to add street and birthday of the user into the table.
      Parameters:
      table - The provided Table for the data.
    • Disease

      private static void Disease(com.itextpdf.layout.element.Table table, boolean forAppointment) throws SQLException
      Method to add the health-problems of the user into the table.
      Parameters:
      table - The provided table for the data.
      forAppointment - true if only the health information for the appointment in creation shall be included
      Throws:
      SQLException - Throws Exception during connection issues with the Database.
    • InsuranceData

      private static void InsuranceData(com.itextpdf.layout.element.Table table)
      Method to add insurance name and type into the table.
      Parameters:
      table - The provided table for the data.