Class PDFGeneratorImpl
- java.lang.Object
-
- io.mosip.kernel.pdfgenerator.itext.impl.PDFGeneratorImpl
-
- All Implemented Interfaces:
PDFGenerator
@Component public class PDFGeneratorImpl extends Object implements PDFGenerator
The PdfGeneratorImpl is the class you will use most when converting processed Template to PDF. It contains a series of methods that accept processed Template as aString,File, orInputStream, and convert it to PDF in the form of anOutputStream,File- Since:
- 1.0.0
- Author:
- Urvil Joshi, Uday Kumar, Neha
-
-
Constructor Summary
Constructors Constructor Description PDFGeneratorImpl()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description byte[]asPDF(List<BufferedImage> bufferedImages)OutputStreamgenerate(InputStream is)OutputStreamgenerate(InputStream is, String resourceLoc)OutputStreamgenerate(String template)voidgenerate(String templatePath, String outpuFilePath, String outputFileName)byte[]mergePDF(List<URL> pdfFiles)OutputStreamsignAndEncryptPDF(byte[] pdf, Rectangle rectangle, String reason, int pageNumber, Provider provider, CertificateEntry<X509Certificate,PrivateKey> certificateEntry, String password)
-
-
-
Method Detail
-
generate
public OutputStream generate(InputStream is) throws IOException
- Specified by:
generatein interfacePDFGenerator- Throws:
IOException
-
generate
public OutputStream generate(String template) throws IOException
- Specified by:
generatein interfacePDFGenerator- Throws:
IOException
-
generate
public void generate(String templatePath, String outpuFilePath, String outputFileName) throws IOException
- Specified by:
generatein interfacePDFGenerator- Throws:
IOException
-
generate
public OutputStream generate(InputStream is, String resourceLoc) throws IOException
- Specified by:
generatein interfacePDFGenerator- Throws:
IOException
-
asPDF
public byte[] asPDF(List<BufferedImage> bufferedImages) throws IOException
- Specified by:
asPDFin interfacePDFGenerator- Throws:
IOException
-
mergePDF
public byte[] mergePDF(List<URL> pdfFiles) throws IOException
- Specified by:
mergePDFin interfacePDFGenerator- Throws:
IOException
-
signAndEncryptPDF
public OutputStream signAndEncryptPDF(byte[] pdf, Rectangle rectangle, String reason, int pageNumber, Provider provider, CertificateEntry<X509Certificate,PrivateKey> certificateEntry, String password) throws IOException, GeneralSecurityException
- Specified by:
signAndEncryptPDFin interfacePDFGenerator- Throws:
IOExceptionGeneralSecurityException
-
-