Class PdfServiceImpl

java.lang.Object
it.unimib.unimibmodules.service.PdfServiceImpl
All Implemented Interfaces:
PdfService

@Component("pdfService") public class PdfServiceImpl extends Object implements PdfService
Service for sending emails.
Version:
0.4.1
Author:
Lorenzo Occhipinti
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    private static com.itextpdf.text.Font
     
    private static final org.apache.logging.log4j.Logger
     
    private static com.itextpdf.text.Font
     
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    private 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
    addImage(com.itextpdf.text.Paragraph anchor, String url, float scaler)
     
    private static void
    addMetaData(com.itextpdf.text.Document document, String name)
     
    private static void
    addTitle(com.itextpdf.text.Paragraph preface, String name)
     
    byte[]
    createPDF(List<Answer> answers)
    Create A pdf file

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • 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 interface PdfService
      Parameters:
      answers - the answers given
      Returns:
      the generated pdf
      Throws:
      com.itextpdf.text.DocumentException
      IOException
    • addMetaData

      private static void addMetaData(com.itextpdf.text.Document document, String name)
    • 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

      private static void addTitle(com.itextpdf.text.Paragraph preface, String name)
    • addClosedAnswers

      private static void addClosedAnswers(com.itextpdf.text.Paragraph paragraph, Answer answer)
    • 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)