Interface PDFGenerator


  • public interface PDFGenerator
    This interface is has specifications for PDF generation from different types. The user of this interface will have basic functionalities related to PDF.
    Since:
    1.0.0
    Author:
    Urvil Joshi, Uday Kumar, Neha
    • Method Detail

      • generate

        OutputStream generate​(String template)
                       throws IOException
        This method will convert process Template as String to outpustStream
        Parameters:
        template - the processedTemplate in the form of a String
        Returns:
        OutputStream PDF Output Stream (PDF stream)
        Throws:
        IOException - Signals that an I/O exception has occurred.
      • generate

        void generate​(String templatePath,
                      String outputFilePath,
                      String outputFileName)
               throws IOException
        This method will take input as template file and convert template to PDF and save to the given path with given fileName.
        Parameters:
        templatePath - the processedTemplate in the form of a String
        outputFilePath - Output File Path
        outputFileName - Output File Name
        Throws:
        IOException - Signals that an I/O exception has occurred.
      • generate

        OutputStream generate​(InputStream dataStream,
                              String resourceLoc)
                       throws IOException
        This method will convert InputStream to OutputStream.
        Parameters:
        dataStream - the processedTemplate in the form of a InputStream.
        resourceLoc - resourceLoction String.
        Returns:
        outpustStream PDF Output Stream (PDF stream).
        Throws:
        IOException - Signals that an I/O exception has occurred.
      • asPDF

        byte[] asPDF​(List<BufferedImage> bufferedImages)
              throws IOException
        This method will convert BufferedImage list to Byte Array.
        Parameters:
        bufferedImages - the input image to convert as PDF.
        Returns:
        array comprising PDF.
        Throws:
        IOException - Signals that an I/O exception has occurred.
      • mergePDF

        byte[] mergePDF​(List<URL> pdfLists)
                 throws IOException
        This method will merge all the PDF files.
        Parameters:
        pdfLists - the URL list of PDF files.
        Returns:
        the byte array comprising merged file.
        Throws:
        IOException - Signals that an I/O exception has occurred.