@Named @Singleton public class PdfHandler extends java.lang.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,
java.io.InputStream inputPdf,
java.io.OutputStream resultingPdf)
Append an invoice to a PDF.
|
Invoice |
extractInvoice(java.io.File pdfFile)
Extract invoice from given pdf file
|
Invoice |
extractInvoice(java.io.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, java.io.InputStream inputPdf, java.io.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(java.io.File pdfFile) throws java.io.FileNotFoundException
Extract invoice from given pdf file
pdfFile
- the pdf file containing the ZUGFeRD XML Filejava.io.FileNotFoundException
- if the pdf is not foundpublic Invoice extractInvoice(java.io.InputStream pdfInputStream)
Extract invoice from given pdf stream
pdfInputStream
- the pdf input streamCopyright © 2014-2018 Konik.io. All Rights Reserved.