Package com.ehealthsystem.pdf
Class CreatePDF
java.lang.Object
com.ehealthsystem.pdf.CreatePDF
Class for creating a PDF document.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprivate static com.itextpdf.layout.element.ParagraphCenteredParagraph(com.itextpdf.layout.element.Text text, float width) Method to center the text.static voidcreate_Pdf(String dest, boolean forAppointment) Method to create a PDF document with the health information and data of the user.private static voidDisease(com.itextpdf.layout.element.Table table, boolean forAppointment) Method to add the health-problems of the user into the table.private static voidInsuranceData(com.itextpdf.layout.element.Table table) Method to add insurance name and type into the table.private static voidPersonalData1(com.itextpdf.layout.element.Table table) Method to add first and last name of the user into the table.private static voidPersonalData2(com.itextpdf.layout.element.Table table) Method to add street and birthday of the user into the table.
-
Constructor Details
-
CreatePDF
public CreatePDF()
-
-
Method Details
-
create_Pdf
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.
-