Example usage for com.itextpdf.text.pdf PdfAStamper PdfAStamper

List of usage examples for com.itextpdf.text.pdf PdfAStamper PdfAStamper

Introduction

In this page you can find the example usage for com.itextpdf.text.pdf PdfAStamper PdfAStamper.

Prototype

public PdfAStamper(final PdfReader reader, final OutputStream os, final PdfAConformanceLevel conformanceLevel)
        throws DocumentException, IOException 

Source Link

Document

Starts the process of adding extra content to an existing PDF document keeping the document PDF/A conformant.

Usage

From source file:io.konik.carriage.itext.ITextInvoiceAppender.java

License:Open Source License

/**
 * Append invoice intern.//  w  ww  .j  a  v  a  2 s  .  c o m
 *
 * @param appendable the appendable
 * @throws IOException Signals that an I/O exception has occurred.
 * @throws DocumentException the document exception
 * @throws XMPException the XMP exception
 */
private void appendInvoiceIntern(AppendParameter appendable)
        throws IOException, DocumentException, XMPException {
    byte[] attachmentFile = convertToByteArray(appendable.attachmentFile());
    PdfReader reader = new PdfReader(appendable.inputPdf());
    PdfAStamper stamper = new PdfAStamper(reader, appendable.resultingPdf(), PdfAConformanceLevel.PDF_A_3B);

    appendZfMetadata(stamper, appendable.zugferdConformanceLevel(), appendable.zugferdVersion());
    attachFile(attachmentFile, stamper);

    stamper.close();
    reader.close();
}