Package it.unimib.unimibmodules.service
Class PdfServiceImpl
java.lang.Object
it.unimib.unimibmodules.service.PdfServiceImpl
- All Implemented Interfaces:
PdfService
Service for sending emails.
- Version:
- 0.4.1
- Author:
- Lorenzo Occhipinti
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprivate static void
addClosedAnswers
(com.itextpdf.text.Paragraph paragraph, Answer answer) private static void
addContent
(com.itextpdf.text.Document document, List<Answer> answers) private static void
addEmptyLine
(com.itextpdf.text.Paragraph paragraph, int number) private static void
private static void
addMetaData
(com.itextpdf.text.Document document, String name) private static void
byte[]
Create A pdf file
-
Field Details
-
logger
private static final org.apache.logging.log4j.Logger logger -
catFont
private static com.itextpdf.text.Font catFont -
subFont
private static com.itextpdf.text.Font subFont
-
-
Constructor Details
-
PdfServiceImpl
public PdfServiceImpl()
-
-
Method Details
-
createPDF
public byte[] createPDF(List<Answer> answers) throws com.itextpdf.text.DocumentException, IOException Create A pdf file- Specified by:
createPDF
in interfacePdfService
- Parameters:
answers
- the answers given- Returns:
- the generated pdf
- Throws:
com.itextpdf.text.DocumentException
IOException
-
addMetaData
-
addContent
private static void addContent(com.itextpdf.text.Document document, List<Answer> answers) throws com.itextpdf.text.DocumentException, IOException - Throws:
com.itextpdf.text.DocumentException
IOException
-
addTitle
-
addClosedAnswers
-
addImage
private static void addImage(com.itextpdf.text.Paragraph anchor, String url, float scaler) throws IOException - Throws:
IOException
-
addEmptyLine
private static void addEmptyLine(com.itextpdf.text.Paragraph paragraph, int number)
-