Class PdfConcatenate


  • public class PdfConcatenate
    extends Object
    Wrapper class for PdfCopy and PdfSmartCopy. Allows you to concatenate existing PDF documents with much less code.
    • Field Detail

      • document

        protected Document document
        The Document object for PdfCopy.
      • copy

        protected PdfCopy copy
        The actual PdfWriter
    • Constructor Detail

      • PdfConcatenate

        public PdfConcatenate​(OutputStream os,
                              boolean smart)
                       throws DocumentException
        Creates an instance of the concatenation class.
        Parameters:
        os - the OutputStream for the PDF document
        smart - do we want PdfCopy to detect redundant content?
        Throws:
        DocumentException
    • Method Detail

      • getWriter

        public PdfCopy getWriter()
        Gets the PdfCopy instance so that you can add bookmarks or change preferences before you close PdfConcatenate.
      • open

        public void open()
        Opens the document (if it isn't open already). Opening the document is done implicitly.
      • close

        public void close()
        We've finished writing the concatenated document.