@Named @Singleton public class PdfHandler extends Object
Transforms, appends or extracts invoices to PDFs.
| Constructor and Description |
|---|
PdfHandler()
Instantiates a default invoice transformer using the Service loader to inject an PDF carriage that should be on the classpath.
|
PdfHandler(io.konik.harness.FileAppender fileAppender,
io.konik.harness.FileExtractor fileExtractor,
InvoiceTransformer transformer)
Instantiates a new PDF handler.
|
| Modifier and Type | Method and Description |
|---|---|
void |
appendInvoice(Invoice invoice,
InputStream inputPdf,
OutputStream resultingPdf)
Append an invoice to a PDF.
|
Invoice |
extractInvoice(File pdfFile)
Extract invoice from given pdf file
|
Invoice |
extractInvoice(InputStream pdfInputStream)
Extract invoice from given pdf stream
|
public PdfHandler()
Instantiates a default invoice transformer using the Service loader to inject an PDF carriage that should be on the classpath.
If error is thrown check you have a Konik PDF Carriage on the classpath.
@Inject public PdfHandler(io.konik.harness.FileAppender fileAppender, io.konik.harness.FileExtractor fileExtractor, InvoiceTransformer transformer)
Instantiates a new PDF handler.
fileAppender - the file appenderfileExtractor - the file extractortransformer - the invoice model transformerpublic void appendInvoice(Invoice invoice, InputStream inputPdf, OutputStream resultingPdf)
Append an invoice to a PDF.
The resulting Pdf Output is based on the input PDF, but might be converted to PDF/A-3 when needed.
invoice - that should be attached to the pdf.inputPdf - to witch we are going to append the invoice to, input will not be modifiedresultingPdf - is the modified copy of the input PDF with the invoice.public Invoice extractInvoice(File pdfFile) throws FileNotFoundException
Extract invoice from given pdf file
pdfFile - the pdf file containing the ZUGFeRD XML FileFileNotFoundException - if the pdf is not foundpublic Invoice extractInvoice(InputStream pdfInputStream)
Extract invoice from given pdf stream
pdfInputStream - the pdf input streamCopyright © 2014-2016 Konik.io. All Rights Reserved.